summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/fapachi.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/fapachi.py')
-rw-r--r--gallery_dl/extractor/fapachi.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/gallery_dl/extractor/fapachi.py b/gallery_dl/extractor/fapachi.py
index 43627e2..7ff71b0 100644
--- a/gallery_dl/extractor/fapachi.py
+++ b/gallery_dl/extractor/fapachi.py
@@ -31,8 +31,7 @@ class FapachiPostExtractor(Extractor):
"user": self.user,
"id" : self.id,
}
- page = self.request("{}/{}/media/{}".format(
- self.root, self.user, self.id)).text
+ page = self.request(f"{self.root}/{self.user}/media/{self.id}").text
url = self.root + text.extract(
page, 'data-src="', '"', page.index('class="media-img'))[0]
yield Message.Directory, data
@@ -50,17 +49,16 @@ class FapachiUserExtractor(Extractor):
def __init__(self, match):
Extractor.__init__(self, match)
- self.user = match.group(1)
- self.num = text.parse_int(match.group(2), 1)
+ self.user = match[1]
+ self.num = text.parse_int(match[2], 1)
def items(self):
data = {"_extractor": FapachiPostExtractor}
while True:
- page = self.request("{}/{}/page/{}".format(
- self.root, self.user, self.num)).text
+ url = f"{self.root}/{self.user}/page/{self.num}"
+ page = self.request(url).text
for post in text.extract_iter(page, 'model-media-prew">', ">"):
- path = text.extr(post, '<a href="', '"')
- if path:
+ if path := text.extr(post, '<a href="', '"'):
yield Message.Queue, self.root + path, data
if '">Next page</a>' not in page: