aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/imgpile.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/imgpile.py')
-rw-r--r--gallery_dl/extractor/imgpile.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/gallery_dl/extractor/imgpile.py b/gallery_dl/extractor/imgpile.py
index f634203..c73926a 100644
--- a/gallery_dl/extractor/imgpile.py
+++ b/gallery_dl/extractor/imgpile.py
@@ -22,13 +22,10 @@ class ImgpileExtractor(Extractor):
"{post[title]} ({post[id_slug]})")
archive_fmt = "{post[id_slug]}_{id}"
- def items(self):
- pass
-
class ImgpilePostExtractor(ImgpileExtractor):
subcategory = "post"
- pattern = rf"{BASE_PATTERN}/p/(\w+)"
+ pattern = BASE_PATTERN + r"/p/(\w+)"
example = "https://imgpile.com/p/AbCdEfG"
def items(self):
@@ -71,24 +68,23 @@ class ImgpilePostExtractor(ImgpileExtractor):
"id_slug": text.extr(media, 'data-id="', '"'),
"id" : text.parse_int(text.extr(
media, 'data-media-id="', '"')),
- "url": f"""http{text.extr(media, '<a href="http', '"')}""",
+ "url": "http" + text.extr(media, '<a href="http', '"'),
})
return files
class ImgpileUserExtractor(ImgpileExtractor):
subcategory = "user"
- pattern = rf"{BASE_PATTERN}/u/([^/?#]+)"
+ pattern = BASE_PATTERN + r"/u/([^/?#]+)"
example = "https://imgpile.com/u/USER"
def items(self):
- url = f"{self.root}/api/v1/posts"
+ url = self.root + "/api/v1/posts"
params = {
"limit" : "100",
"sort" : "latest",
"period" : "all",
"visibility": "public",
- # "moderation_status": "approved",
"username" : self.groups[0],
}
headers = {
@@ -101,7 +97,7 @@ class ImgpileUserExtractor(ImgpileExtractor):
"Sec-Fetch-Site": "same-origin",
}
- base = f"{self.root}/p/"
+ base = self.root + "/p/"
while True:
data = self.request_json(url, params=params, headers=headers)
@@ -111,7 +107,7 @@ class ImgpileUserExtractor(ImgpileExtractor):
for item in data["data"]:
item["_extractor"] = ImgpilePostExtractor
- url = f"{base}{item['slug']}"
+ url = base + item["slug"]
yield Message.Queue, url, item
url = data["links"].get("next")