summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/erome.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2025-09-07 20:40:45 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2025-09-07 20:40:45 -0400
commit243b2597edb922fe7e0b0d887e80bb7ebbe72ab7 (patch)
tree1a42ddec8ae1f21e3c4c88849818e1ea9140aaaa /gallery_dl/extractor/erome.py
parent1df55d9de48105dace9cc16f1511dba3c9a6da6f (diff)
New upstream version 1.30.6.upstream/1.30.6
Diffstat (limited to 'gallery_dl/extractor/erome.py')
-rw-r--r--gallery_dl/extractor/erome.py21
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)