From 291369eab2ef4287497e292d12ea2d5215d97af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 5 Dec 2017 23:29:11 +0100 Subject: [PATCH] various smaller changes/additions --- gallery_dl/extractor/gelbooru.py | 9 +-------- gallery_dl/extractor/khinsider.py | 4 ++-- gallery_dl/job.py | 2 +- gallery_dl/option.py | 10 ++++++---- test/test_extractors.py | 1 - 5 files changed, 10 insertions(+), 16 deletions(-) diff --git a/gallery_dl/extractor/gelbooru.py b/gallery_dl/extractor/gelbooru.py index 8b981c72..b5918509 100644 --- a/gallery_dl/extractor/gelbooru.py +++ b/gallery_dl/extractor/gelbooru.py @@ -61,7 +61,7 @@ class GelbooruExtractor(SharedConfigExtractor): ))[0] data["file_url"] = "http" + data["file_url"] data["md5"] = data["file_url"].rpartition("/")[2].partition(".")[0] - data["rating"] = RATING_MAP[data["rating"]] + data["rating"] = (data["rating"] or "?")[0].lower() for key in ("id", "width", "height", "score"): data[key] = util.safe_int(data[key]) return data @@ -153,10 +153,3 @@ class GelbooruPostExtractor(GelbooruExtractor): def get_posts(self): return (self.post_id,) - - -RATING_MAP = { - "Safe": "s", - "Questionable": "q", - "Explicit": "e", -} diff --git a/gallery_dl/extractor/khinsider.py b/gallery_dl/extractor/khinsider.py index 9ee85511..42cb8b8c 100644 --- a/gallery_dl/extractor/khinsider.py +++ b/gallery_dl/extractor/khinsider.py @@ -58,9 +58,9 @@ class KhinsiderSoundtrackExtractor(AsynchronousExtractor): def get_album_tracks(self, page): """Collect url and metadata for all tracks of a soundtrack""" - page = text.extract(page, '', '
')[0] + page = text.extract(page, '', '
')[0] for num, url in enumerate(text.extract_iter( - page, ' href="', '"'), 1): + page, '= 1000 and " + "Available keys are the filename-specific ones listed by '-K'. " + "Example: --filter \"image_width >= 1000 and " "rating in ('s', 'q')\""), ) selection.add_argument( diff --git a/test/test_extractors.py b/test/test_extractors.py index 88c1863b..3e5cee7c 100644 --- a/test/test_extractors.py +++ b/test/test_extractors.py @@ -82,7 +82,6 @@ skip = [ "exhentai", "kissmanga", "mangafox", "dynastyscans", "nijie", "archivedmoe", "archiveofsins", "thebarchive", # temporary issues - "turboimagehost", ] # enable selective testing for direct calls if __name__ == '__main__' and len(sys.argv) > 1: