mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 18:53:21 +01:00
[seiga] raise error when redirected to login page (#3401)
This commit is contained in:
parent
68ce5f965d
commit
7851a2c520
@ -44,7 +44,11 @@ class SeigaExtractor(Extractor):
|
||||
url = "{}/image/source/{}".format(self.root, image_id)
|
||||
response = self.request(
|
||||
url, method="HEAD", allow_redirects=False, notfound="image")
|
||||
return response.headers["Location"].replace("/o/", "/priv/", 1)
|
||||
location = response.headers["location"]
|
||||
if "nicovideo.jp/login" in location:
|
||||
raise exception.StopExtraction(
|
||||
"HTTP redirect to login page (%s)", location.partition("?")[0])
|
||||
return location.replace("/o/", "/priv/", 1)
|
||||
|
||||
|
||||
class SeigaUserExtractor(SeigaExtractor):
|
||||
|
Loading…
Reference in New Issue
Block a user