summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/sankakucomplex.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/sankakucomplex.py')
-rw-r--r--gallery_dl/extractor/sankakucomplex.py24
1 files changed, 10 insertions, 14 deletions
diff --git a/gallery_dl/extractor/sankakucomplex.py b/gallery_dl/extractor/sankakucomplex.py
index 50c21e3..405e07e 100644
--- a/gallery_dl/extractor/sankakucomplex.py
+++ b/gallery_dl/extractor/sankakucomplex.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2019-2023 Mike Fährmann
+# Copyright 2019-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
@@ -10,7 +10,6 @@
from .common import Extractor, Message
from .. import text, util
-import re
class SankakucomplexExtractor(Extractor):
@@ -20,7 +19,7 @@ class SankakucomplexExtractor(Extractor):
def __init__(self, match):
Extractor.__init__(self, match)
- self.path = match.group(1)
+ self.path = match[1]
class SankakucomplexArticleExtractor(SankakucomplexExtractor):
@@ -34,7 +33,7 @@ class SankakucomplexArticleExtractor(SankakucomplexExtractor):
example = "https://news.sankakucomplex.com/1970/01/01/TITLE"
def items(self):
- url = "{}/{}/?pg=X".format(self.root, self.path)
+ url = f"{self.root}/{self.path}/?pg=X"
extr = text.extract_from(self.request(url).text)
data = {
"title" : text.unescape(
@@ -64,23 +63,20 @@ class SankakucomplexArticleExtractor(SankakucomplexExtractor):
file.update(data)
yield Message.Url, url, file
- @staticmethod
- def _extract_images(content):
- orig_sub = re.compile(r"-\d+x\d+\.").sub
+ def _extract_images(self, content):
+ orig_sub = util.re(r"-\d+x\d+\.").sub
return [
orig_sub(".", url) for url in
util.unique(text.extract_iter(content, 'data-lazy-src="', '"'))
]
- @staticmethod
- def _extract_videos(content):
- return re.findall(r"<source [^>]*src=[\"']([^\"']+)", content)
+ def _extract_videos(self, content):
+ return util.re(r"<source [^>]*src=[\"']([^\"']+)").findall(content)
- @staticmethod
- def _extract_embeds(content):
+ def _extract_embeds(self, content):
return [
"ytdl:" + url for url in
- re.findall(r"<iframe [^>]*src=[\"']([^\"']+)", content)
+ util.re(r"<iframe [^>]*src=[\"']([^\"']+)").findall(content)
]
@@ -96,7 +92,7 @@ class SankakucomplexTagExtractor(SankakucomplexExtractor):
data = {"_extractor": SankakucomplexArticleExtractor}
while True:
- url = "{}/{}/page/{}/".format(self.root, self.path, pnum)
+ url = f"{self.root}/{self.path}/page/{pnum}/"
response = self.request(url, fatal=False)
if response.status_code >= 400:
return