Mercurial > hg > cc > cirrus_work
view lib/python/cc/count_warc.py @ 201:3406742894fc
compute (component) uri lengths and a few other properties
| author | Henry S. Thompson <ht@inf.ed.ac.uk> |
|---|---|
| date | Tue, 05 Dec 2023 10:35:15 +0000 |
| parents | 1d1bd22124c0 |
| children |
line wrap: on
line source
#!/usr/bin/env python3 import warc,sys OUT=open(sys.stdout.fileno(),'wb') if (debug:=(sys.argv[1]=='-d')): sys.argv.pop(1) def countme(wtype,buf,part): if debug: breakpoint() OUT.write(b"%d\n"%len(buf)) #warc(showme,[b'response','warcinfo','request','metadata'],int(sys.argv[2])) #warc(showme,[b'response'],whole=True) warc.warc(sys.argv[1],countme,[b'response'],parts=int(sys.argv[2]),debug=debug)
