diff --git a/webarchiv.py b/webarchiv.py index 58a09f70fbe9e35f4ccf5db8b8693df9543f72ba..ea466bac4a2b695a197260892f95d9a8fef22de2 100644 --- a/webarchiv.py +++ b/webarchiv.py @@ -123,7 +123,6 @@ class WebarchivSession: elif r.status_code == 410: print('The requested API Version (via X-API-VERSION Header) is not available', file=sys.stderr) return r - raise HTTPError(response=r) def fulltext_search(self, query_string, from_=None, to_=None): """ @@ -195,15 +194,17 @@ class WebarchivSession: """ this is the pollingrequest for the given typen of request - :param response: String to search for + :param resp: String to search for :return: response """ requestid = resp.json()['requestid'] - type = resp.json()['type'] - if type == 1: + type_ = resp.json()['type'] + if type_ == 1: r = self._get(op='/search/status/fulltext', params={'requestid': requestid}) - elif type == 2: + elif type_ == 2: r = self._get(op='/search/status/wayback', params={'requestid': requestid}) + else: + raise NotImplementedError(f'Unknown status query type {type_} - Please update client.') return r @@ -235,8 +236,6 @@ class WebarchivSession: Start a domain name search in the Webarchive. :param query_string: String to search for - :param page_: The page number parameter works with the page size parameter to control the offset of the records returned in the results. Default value is 1 - :param pagesize_: The page size parameter works with the page number parameter to control the offset of the records returned in the results. It also controls how many results are returned with each request. Default value is 10 :return: result as json """ params = {'q': query_string}