summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/seiga.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/seiga.py')
-rw-r--r--gallery_dl/extractor/seiga.py16
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, (