Browse Source

Log retrieval of showNumPages

master
JustAnotherArchivist 2 years ago
parent
commit
5121524f83
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      ia-cdx-search

+ 3
- 1
ia-cdx-search View File

@@ -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')


Loading…
Cancel
Save