just count the status code, consumes less memory

This commit is contained in:
akamhy 2020-05-08 09:28:18 +05:30 committed by GitHub
parent 58a6409528
commit e9d010c793
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,7 +132,7 @@ def total_archives(url, UA=default_UA):
url_check(url) url_check(url)
hdr = { 'User-Agent' : '%s' % UA } hdr = { 'User-Agent' : '%s' % UA }
request_url = "https://web.archive.org/cdx/search/cdx?url=%s&output=json" % clean_url(url) request_url = "https://web.archive.org/cdx/search/cdx?url=%s&output=json&fl=statuscode" % clean_url(url)
req = Request(request_url, headers=hdr) # nosec req = Request(request_url, headers=hdr) # nosec
try: try: