Skip to content

Commit

Permalink
[aryion] get post ID via gallery-item (fixes #981, closes #982)
Browse files Browse the repository at this point in the history
this even works when fetching post IDs from '/latest.php?id='
  • Loading branch information
mikf committed Sep 6, 2020
1 parent 799ca07 commit bc48514
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gallery_dl/extractor/aryion.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(self, match):
Extractor.__init__(self, match)
self.user = match.group(1)
self.recursive = True
self._needle = "class='gallery-item' id='"

def login(self):
username, password = self._get_auth_info()
Expand Down Expand Up @@ -73,7 +74,7 @@ def _pagination(self, url):
while True:
page = self.request(url).text
yield from text.extract_iter(
page, "class='thumb' href='/g4/view/", "'")
page, self._needle, "'")

pos = page.find("Next >>")
if pos < 0:
Expand Down Expand Up @@ -180,6 +181,7 @@ def posts(self):
url = "{}/g4/gallery/{}".format(self.root, self.user)
return self._pagination(url)
else:
self._needle = "class='thumb' href='/g4/view/"
url = "{}/g4/latest.php?name={}".format(self.root, self.user)
return util.advance(self._pagination(url), self.offset)

Expand Down

0 comments on commit bc48514

Please sign in to comment.