Skip to content

Commit

Permalink
Merge pull request #58 from DankCity/57-fix-gallery-parsing
Browse files Browse the repository at this point in the history
Improve logic for parsing Imgur galleries
  • Loading branch information
levi-rs committed May 7, 2016
2 parents 7bcc9d0 + 49dfca0 commit aba3e57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dankbot/memes.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def _parse_as_gallery(self):
"""
# Entry point format: imgur.com/gallery/{gallery_post_id}
# Entry point format: imgur.com/gallery/{gallery_post_id}/new
gallery_post_id = self.link.split('/')[-1].split('/new')[0]
gallery_post_id = self.link.split('/new')[0].strip('/').split('/')[-1]
response = self._get_client().gallery_item(gallery_post_id)

if response.is_album:
Expand Down

0 comments on commit aba3e57

Please sign in to comment.