replace extractor.request() 'expect' argument
with - 'fatal': allow 4xx status codes - 'notfound': raise NotFoundError on 404
This commit is contained in:
@@ -110,8 +110,8 @@ class SankakucomplexTagExtractor(SankakucomplexExtractor):
|
||||
yield Message.Version, 1
|
||||
while True:
|
||||
url = "{}/{}/page/{}/".format(self.root, self.path, pnum)
|
||||
response = self.request(url, expect=(404,))
|
||||
if response.status_code == 404:
|
||||
response = self.request(url, fatal=False)
|
||||
if response.status_code >= 400:
|
||||
return
|
||||
for url in text.extract_iter(response.text, 'data-direct="', '"'):
|
||||
if url != last:
|
||||
|
||||
Reference in New Issue
Block a user