diff options
| author | 2025-07-31 01:22:01 -0400 | |
|---|---|---|
| committer | 2025-07-31 01:22:01 -0400 | |
| commit | a6e995c093de8aae2e91a0787281bb34c0b871eb (patch) | |
| tree | 2d79821b05300d34d8871eb6c9662b359a2de85d /gallery_dl/extractor/seiga.py | |
| parent | 7672a750cb74bf31e21d76aad2776367fd476155 (diff) | |
New upstream version 1.30.2.upstream/1.30.2
Diffstat (limited to 'gallery_dl/extractor/seiga.py')
| -rw-r--r-- | gallery_dl/extractor/seiga.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gallery_dl/extractor/seiga.py b/gallery_dl/extractor/seiga.py index ff8c505..7319731 100644 --- a/gallery_dl/extractor/seiga.py +++ b/gallery_dl/extractor/seiga.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2016-2023 Mike Fährmann +# Copyright 2016-2025 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -42,11 +42,11 @@ class SeigaExtractor(Extractor): def get_image_url(self, image_id): """Get url for an image with id 'image_id'""" - url = "{}/image/source/{}".format(self.root, image_id) + url = f"{self.root}/image/source/{image_id}" location = self.request_location(url, notfound="image") if "nicovideo.jp/login" in location: - raise exception.StopExtraction( - "HTTP redirect to login page (%s)", location.partition("?")[0]) + raise exception.AbortExtraction( + f"HTTP redirect to login page ({location.partition('?')[0]})") return location.replace("/o/", "/priv/", 1) def login(self): @@ -81,7 +81,7 @@ class SeigaExtractor(Extractor): if "/mfa" in response.url: page = response.text email = text.extr(page, 'class="userAccount">', "<") - code = self.input("Email Confirmation Code ({}): ".format(email)) + code = self.input(f"Email Confirmation Code ({email}): ") data = { "otp": code, @@ -145,7 +145,7 @@ class SeigaUserExtractor(SeigaExtractor): } def get_images(self): - url = "{}/user/illust/{}".format(self.root, self.user_id) + url = f"{self.root}/user/illust/{self.user_id}" params = {"sort": self.order, "page": self.start_page, "target": "illust_all"} @@ -187,7 +187,7 @@ class SeigaImageExtractor(SeigaExtractor): def __init__(self, match): SeigaExtractor.__init__(self, match) - self.image_id = match.group(1) + self.image_id = match[1] def skip(self, num): self.start_image += num @@ -197,7 +197,7 @@ class SeigaImageExtractor(SeigaExtractor): self.cookies.set( "skip_fetish_warning", "1", domain="seiga.nicovideo.jp") - url = "{}/seiga/im{}".format(self.root, self.image_id) + url = f"{self.root}/seiga/im{self.image_id}" page = self.request(url, notfound="image").text data = text.extract_all(page, ( |
