diff options
| author | 2025-12-20 05:49:11 -0500 | |
|---|---|---|
| committer | 2025-12-20 05:49:11 -0500 | |
| commit | c586ea4b3c871f5696626f9820e8c88a4e78f4a6 (patch) | |
| tree | e6d7bae96282c3d147159f091d451e53bdaa2efe /gallery_dl/extractor/shimmie2.py | |
| parent | 01a2bf622c31072d1322884584404b9bd59b28cc (diff) | |
| parent | a24ec1647aeac35a63b744ea856011ad6e06be3b (diff) | |
Update upstream source from tag 'upstream/1.31.1'
Update to upstream version '1.31.1'
with Debian dir b5d91c25143175f933b1c69c7e82249cd7e145ab
Diffstat (limited to 'gallery_dl/extractor/shimmie2.py')
| -rw-r--r-- | gallery_dl/extractor/shimmie2.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gallery_dl/extractor/shimmie2.py b/gallery_dl/extractor/shimmie2.py index 36b083b..5572b4d 100644 --- a/gallery_dl/extractor/shimmie2.py +++ b/gallery_dl/extractor/shimmie2.py @@ -25,6 +25,8 @@ class Shimmie2Extractor(BaseExtractor): if file_url := self.config_instance("file_url"): self.file_url_fmt = file_url + if quote := self.config_instance("quote"): + self._quote_type = lambda _: quote def items(self): data = self.metadata() @@ -44,7 +46,7 @@ class Shimmie2Extractor(BaseExtractor): else: text.nameext_from_url(url, post) - yield Message.Directory, post + yield Message.Directory, "", post yield Message.Url, url, post def metadata(self): @@ -85,6 +87,11 @@ BASE_PATTERN = Shimmie2Extractor.update({ "root": "https://co.llection.pics", "pattern": r"co\.llection\.pics", }, + "soybooru": { + "root": "https://soybooru.com", + "pattern": r"soybooru\.com", + "quote": "'", + }, }) + r"/(?:index\.php\?q=/?)?" @@ -93,7 +100,7 @@ class Shimmie2TagExtractor(Shimmie2Extractor): subcategory = "tag" directory_fmt = ("{category}", "{search_tags}") file_url_fmt = "{}/_images/{}/{}%20-%20{}.{}" - pattern = BASE_PATTERN + r"post/list/([^/?#]+)(?:/(\d+))?" + pattern = rf"{BASE_PATTERN}post/list/([^/?#]+)(?:/(\d+))?" example = "https://vidya.pics/post/list/TAG/1" def metadata(self): @@ -150,15 +157,14 @@ class Shimmie2TagExtractor(Shimmie2Extractor): } pnum += 1 - if not extr(">Next<", ">"): - if not extr(f"/{pnum}'>{pnum}<", ">"): - return + if not extr(f"/{pnum}{quote}>Next</", ">"): + return class Shimmie2PostExtractor(Shimmie2Extractor): """Extractor for single shimmie2 posts""" subcategory = "post" - pattern = BASE_PATTERN + r"post/view/(\d+)" + pattern = rf"{BASE_PATTERN}post/view/(\d+)" example = "https://vidya.pics/post/view/12345" def posts(self): |
