1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

code cleanup and fixing tests

This commit is contained in:
Mike Fährmann 2017-06-02 09:10:58 +02:00
parent dfe82526ee
commit c921b4f32a
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
8 changed files with 16 additions and 16 deletions

View File

@ -25,8 +25,12 @@ Supported Sites
+-------------------+---------------------------------------+----------------------------------------------------------+
|Fallen Angels Scans|https://www.fascans.com/ |Chapters, Manga |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Flickr |https://www.flickr.com/ |Albums, individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Gelbooru |https://gelbooru.com/ |Posts, Tag-Searches |
+-------------------+---------------------------------------+----------------------------------------------------------+
|Gfycat |https://gfycat.com/ |individual Images |
+-------------------+---------------------------------------+----------------------------------------------------------+
|GoManga |https://gomanga.co/ |Chapters, Manga |
+-------------------+---------------------------------------+----------------------------------------------------------+
|HBrowse |http://www.hbrowse.com/ |Chapters, Manga |

View File

@ -23,7 +23,6 @@ class DanbooruTagExtractor(DanbooruExtractor, booru.BooruTagExtractor):
pattern = [(r"(?:https?://)?(?:www\.)?danbooru.donmai.us/posts"
r"\?(?:utf8=%E2%9C%93&)?tags=([^&]+)")]
test = [("https://danbooru.donmai.us/posts?tags=bonocho", {
"url": "04f69a187269019f6d0c32dc7685246fe99d536e",
"content": "b196fb9f1668109d7774a0a82efea3ffdda07746",
})]
@ -33,7 +32,6 @@ class DanbooruPoolExtractor(DanbooruExtractor, booru.BooruPoolExtractor):
subcategory = "pool"
pattern = [r"(?:https?://)?(?:www\.)?danbooru.donmai.us/pools/(\d+)"]
test = [("https://danbooru.donmai.us/pools/7659", {
"url": "73c02ec3d67ffd46d489dd6cfd7b35fee053865c",
"content": "b16bab12bea5f7ea9e0a836bf8045f280e113d99",
})]
@ -43,6 +41,5 @@ class DanbooruPostExtractor(DanbooruExtractor, booru.BooruPostExtractor):
subcategory = "post"
pattern = [r"(?:https?://)?(?:www\.)?danbooru.donmai.us/posts/(\d+)"]
test = [("https://danbooru.donmai.us/posts/294929", {
"url": "954a9fec4d507c46e220c9beb4349b303b1f4433",
"content": "5e255713cbf0a8e0801dc423563c34d896bb9229",
})]

View File

@ -249,7 +249,7 @@ class DeviantartJournalExtractor(DeviantartExtractor):
subcategory = "journal"
pattern = [r"(?:https?://)?([^.]+)\.deviantart\.com/journal/?$"]
test = [("http://shimoda7.deviantart.com/journal/", {
"url": "448d14df6b8398273d8e9437ad45dc3f9cdaf68d",
"url": "1637f60bd94dc21da9130c8d84f85009b754cd70",
"keyword": "9ddc2e130198395c1dfaa55c65b6bf63713ec0a8",
})]

View File

@ -24,8 +24,8 @@ class DynastyscansChapterExtractor(Extractor):
test = [
(("http://dynasty-scans.com/chapters/"
"hitoribocchi_no_oo_seikatsu_ch33"), {
"url": "ba945116382eff26b0e52fe1804e6d58fee7734d",
"keyword": "81bfda5b98b34ac2a7324bd9e2abad3df9cc7673",
"url": "ff79ea9956522a8dafd261c1fbe3c74aa8470dc5",
"keyword": "eb837477565ee7e647d08ae0ac60c1108234cb80",
}),
(("http://dynasty-scans.com/chapters/"
"new_game_the_spinoff_special_13"), {

View File

@ -39,17 +39,17 @@ class MangaparkChapterExtractor(Extractor):
r"([^/]+/s(\d+)(?:/v([^/]+))?/c(\d+)(?:([^/]+)|/e(\d+))?)")]
test = [
("http://mangapark.me/manga/gosu/s2/c55", {
"url": "482d4a27c1e7f03cff8afac145d06f3ddeac82bb",
"keyword": "bd97ca24ef344b44292910384215ef3f1005ea2e",
"url": "fefe84492d9118de5962563fbecb9362051c52d5",
"keyword": "652b38c40bdfb5592456b6e7524a3acfdef9fae6",
}),
(("http://mangapark.me/manga/"
"ad-astra-per-aspera-hata-kenjirou/s1/c1.2"), {
"url": "f325ce264df390c5ba9607c52a7e7b0829672404",
"keyword": "6e56986610cb2da9917d0d9d3217d700fbc48665",
"url": "64b47f9837d50c3e57793ff6703d840ef7808c52",
"keyword": "f28eb26b4966bebda0e761f241c2dd49e505ce13",
}),
("http://mangapark.me/manga/gekkan-shoujo-nozaki-kun/s2/c70/e2/1", {
"url": "8534c8286a18c4db47606f84a4df9f1a42bab291",
"keyword": "46a332caa65ef646c9405f69947c27f0dbc5430e",
"url": "f8915e25895d4b336892f8a6bd27d26cdb337045",
"keyword": "34aa6ca3bdf5078f839cbf68ff68e39728cf248b",
})
]

View File

@ -22,8 +22,8 @@ class Job():
self.extractor = extractor.find(url)
if self.extractor is None:
raise exception.NoExtractorError(url)
self.extractor.log.debug("Using %s for %s",
self.extractor.__class__.__name__, url)
self.extractor.log.debug(
"Using %s for %s", self.extractor.__class__.__name__, url)
items = config.get(("images",))
if items:

View File

@ -163,7 +163,7 @@ def map_subcategory(sc):
def category_key(extrlist):
key = extrlist[0].category.lower()
if len(extrlist) == 1 and extrlist[0].subcat == "individual Images":
if len(extrlist) == 1 and extrlist[0].__module__.endswith(".imagehosts"):
key = "zz" + key
return key

View File

@ -51,7 +51,6 @@ skip = [
# dont work on travis-ci
"exhentai", "kissmanga", "mangafox", "dynastyscans", "nijie",
# temporary issues
"mangapark", "imgtrex",
]
# enable selective testing for direct calls
if __name__ == '__main__' and len(sys.argv) > 1: