Skip to content

Commit

Permalink
[motherless] Update media count extractors
Browse files Browse the repository at this point in the history
  • Loading branch information
smackingpotato committed Sep 21, 2024
1 parent 611cb2b commit 58a173f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions gallery_dl/extractor/motherless.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,15 @@ def get_gallery_uploader(page_data):
return re.search('gallery-member-username">[\s\S]+?<a href="/m/(.+?)"', page_data).group(1)

def get_gallery_image_count(page_data):
return int(re.search('Images \(([0-9]+)\)', page_data).group(1))
try:
return int(re.search('Images \(([0-9,]+)\)', page_data).group(1).replace(',', ''))
except AttributeError:
# No images found.
return 0

def get_gallery_video_count(page_data):
return int(re.search('Videos \(([0-9]+)\)', page_data).group(1))
try:
return int(re.search('Videos \(([0-9,]+)\)', page_data).group(1).replace(',', ''))
except AttributeError:
# No images found.
return 0

0 comments on commit 58a173f

Please sign in to comment.