|
|
@@ -25,7 +25,9 @@ baseUrl = f'https://web.archive.org/cdx/search/cdx?{query}' |
|
|
|
if sys.argv[2:]: |
|
|
|
startPage, numPages = map(int, sys.argv[2:]) |
|
|
|
else: |
|
|
|
req = urllib.request.Request(f'{baseUrl}&showNumPages=true') |
|
|
|
url = f'{baseUrl}&showNumPages=true' |
|
|
|
print(f'GET {url}', file = sys.stderr) |
|
|
|
req = urllib.request.Request(url) |
|
|
|
with urllib.request.urlopen(req) as r: |
|
|
|
if r.getcode() != 200: |
|
|
|
raise RuntimeError(f'Could not fetch number of pages') |
|
|
|