replace extractor.request() 'expect' argument
with - 'fatal': allow 4xx status codes - 'notfound': raise NotFoundError on 404
This commit is contained in:
@@ -49,10 +49,10 @@ class SexcomExtractor(Extractor):
|
||||
return
|
||||
url = text.urljoin(self.root, url)
|
||||
|
||||
def _parse_pin(self, url, expect=range(400, 429)):
|
||||
response = self.request(url, expect=expect)
|
||||
def _parse_pin(self, url):
|
||||
response = self.request(url, fatal=False)
|
||||
if response.status_code >= 400:
|
||||
self.log.warning("Unable to fetch %s (%s: %s)",
|
||||
self.log.warning('Unable to fetch %s ("%s: %s")',
|
||||
url, response.status_code, response.reason)
|
||||
return None
|
||||
extr = text.extract_from(response.text)
|
||||
|
||||
Reference in New Issue
Block a user