diff options
Diffstat (limited to 'gallery_dl/extractor/seiga.py')
| -rw-r--r-- | gallery_dl/extractor/seiga.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gallery_dl/extractor/seiga.py b/gallery_dl/extractor/seiga.py index 22c9487..7b8d2a3 100644 --- a/gallery_dl/extractor/seiga.py +++ b/gallery_dl/extractor/seiga.py @@ -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): |
