diff options
| author | 2025-09-07 20:40:52 -0400 | |
|---|---|---|
| committer | 2025-09-07 20:40:52 -0400 | |
| commit | 88f40b9b0dc47fa22a209e8246d97a43f4b60cb2 (patch) | |
| tree | 5764999c5d1ce99ccebd92dddb7a3914b55e43c2 /gallery_dl/extractor/erome.py | |
| parent | 7ac1b3bb04430b981f4f796fd765499cdc8b67ec (diff) | |
| parent | 243b2597edb922fe7e0b0d887e80bb7ebbe72ab7 (diff) | |
Update upstream source from tag 'upstream/1.30.6'
Update to upstream version '1.30.6'
with Debian dir 9f14996b07ee3246bdcde2ec12796c77da2a3060
Diffstat (limited to 'gallery_dl/extractor/erome.py')
| -rw-r--r-- | gallery_dl/extractor/erome.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/gallery_dl/extractor/erome.py b/gallery_dl/extractor/erome.py index 7beeac5..68cfdbc 100644 --- a/gallery_dl/extractor/erome.py +++ b/gallery_dl/extractor/erome.py @@ -48,10 +48,13 @@ class EromeExtractor(Extractor): self.sleep(5.0, "check") def _pagination(self, url, params): - for params["page"] in itertools.count(1): + find_albums = EromeAlbumExtractor.pattern.findall + + for params["page"] in itertools.count( + text.parse_int(params.get("page"), 1)): page = self.request(url, params=params).text - album_ids = EromeAlbumExtractor.pattern.findall(page)[::2] + album_ids = find_albums(page)[::2] yield from album_ids if len(album_ids) < 36: @@ -114,12 +117,18 @@ class EromeAlbumExtractor(EromeExtractor): class EromeUserExtractor(EromeExtractor): subcategory = "user" - pattern = BASE_PATTERN + r"/(?!a/|search\?)([^/?#]+)" + pattern = BASE_PATTERN + r"/(?!a/|search\?)([^/?#]+)(?:/?\?([^#]+))?" example = "https://www.erome.com/USER" def albums(self): - url = f"{self.root}/{self.groups[0]}" - return self._pagination(url, {}) + user, qs = self.groups + url = f"{self.root}/{user}" + + params = text.parse_query(qs) + if "t" not in params and not self.config("reposts", False): + params["t"] = "posts" + + return self._pagination(url, params) class EromeSearchExtractor(EromeExtractor): @@ -128,7 +137,7 @@ class EromeSearchExtractor(EromeExtractor): example = "https://www.erome.com/search?q=QUERY" def albums(self): - url = self.root + "/search" + url = f"{self.root}/search" params = text.parse_query(self.groups[0]) return self._pagination(url, params) |
