Mercurial > hg > cc > cirrus_work
annotate bin/count_warc.py @ 101:e2e64c3d763e
bug4 fixed, but that created a new, earlier bug
| author | Henry S. Thompson <ht@inf.ed.ac.uk> |
|---|---|
| date | Mon, 11 Sep 2023 22:06:45 +0100 |
| parents | 083229195d12 |
| children |
| rev | line source |
|---|---|
| 44 | 1 #!/usr/bin/env python3 |
| 2 import warc,sys | |
| 3 | |
| 4 OUT=open(sys.stdout.fileno(),'wb') | |
| 5 | |
| 6 if (debug:=(sys.argv[1]=='-d')): | |
| 7 sys.argv.pop(1) | |
| 8 | |
| 9 def countme(wtype,buf,part): | |
| 10 if debug: | |
| 11 breakpoint() | |
| 12 OUT.write(b"%d\n"%len(buf)) | |
| 13 | |
| 14 #warc(showme,[b'response','warcinfo','request','metadata'],int(sys.argv[2])) | |
| 15 #warc(showme,[b'response'],whole=True) | |
| 16 | |
| 17 warc.warc(sys.argv[1],countme,[b'response'],parts=int(sys.argv[2]),debug=debug) |
