Explorar el Código

Log retrieval of showNumPages

master
JustAnotherArchivist hace 2 años
padre
commit
5121524f83
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. +3
    -1
      ia-cdx-search

+ 3
- 1
ia-cdx-search Ver fichero

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


Cargando…
Cancelar
Guardar