From 90830daf85a609664786286d4fae178274882a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sun, 7 Mar 2021 22:31:43 +0100 Subject: [PATCH] [exhentai] improve 'favorites' extraction (closes #1360) add special cases for when the favorite count is 0 (Never) or 1 (Once) --- gallery_dl/extractor/exhentai.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gallery_dl/extractor/exhentai.py b/gallery_dl/extractor/exhentai.py index 5a7de238..552ea4df 100644 --- a/gallery_dl/extractor/exhentai.py +++ b/gallery_dl/extractor/exhentai.py @@ -246,6 +246,12 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor): "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("+", " "))