Skip to content

Commit

Permalink
[exhentai] improve 'favorites' extraction (closes #1360)
Browse files Browse the repository at this point in the history
add special cases for when the favorite count is 0 (Never) or 1 (Once)
  • Loading branch information
mikf committed Mar 7, 2021
1 parent b6719be commit 90830da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gallery_dl/extractor/exhentai.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ def metadata_from_page(self, page):
"torrentcount" : extr('>Torrent Download (', ')'),
}

f = data["favorites"][0]
if f == "N":
data["favorites"] = "0"
elif f == "O":
data["favorites"] = "1"

data["lang"] = util.language_to_code(data["language"])
data["tags"] = [
text.unquote(tag.replace("+", " "))
Expand Down

0 comments on commit 90830da

Please sign in to comment.