diff --git a/docs/configuration.rst b/docs/configuration.rst index 6d607122..f2537ec0 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1973,6 +1973,20 @@ Description `quality `__ ones. +extractor.comick.lang +--------------------- +Type + * ``string`` + * ``list`` of ``strings`` +Example + * ``"en"`` + * ``"fr,it,pl"`` + * ``["fr", "it", "pl"]`` +Description + `ISO 639-1 `__ language codes + to filter chapters by. + + extractor.cyberdrop.domain -------------------------- Type diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index f3b36a94..ce0bad65 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -211,6 +211,10 @@ "quality" : "original=true", "quality-videos": "quality=100" }, + "comick": + { + "lang": "" + }, "coomer": { "username": "", diff --git a/gallery_dl/extractor/comick.py b/gallery_dl/extractor/comick.py index 7ef46070..b6d9b0cc 100644 --- a/gallery_dl/extractor/comick.py +++ b/gallery_dl/extractor/comick.py @@ -160,8 +160,15 @@ class ComickMangaExtractor(ComickBase, MangaExtractor): "Sec-Fetch-Site": "same-site", } - query = text.parse_query(query) - params = {"lang": query.get("lang") or None} + query = text.parse_query_list(query, ("lang",)) + + if (lang := query.get("lang")) or (lang := self.config("lang")): + if not isinstance(lang, str): + lang = ",".join(lang) + else: + lang = None + + params = {"lang": lang} params["page"] = page = text.parse_int(query.get("page"), 1) if date_order := query.get("date-order"): @@ -172,7 +179,7 @@ class ComickMangaExtractor(ComickBase, MangaExtractor): params["chap-order"] = \ "0" if self.config("chapter-reverse", False) else "1" - group = query.get("group", None) + group = query.get("group") if group == "0": group = None diff --git a/test/results/comick.py b/test/results/comick.py index b5340bb2..db503524 100644 --- a/test/results/comick.py +++ b/test/results/comick.py @@ -25,7 +25,7 @@ __tests__ = ( "width" : 1424, "height" : 2000, "size" : range(67460, 276608), - "optimized": None, + "optimized": {int, None}, "volume": 1, "chapter": 10, @@ -36,7 +36,7 @@ __tests__ = ( "count": 5, "page" : range(1, 5), "date": "dt:2025-06-21 13:07:32", - "date_updated": "dt:2025-06-21 16:52:40", + "date_updated": "type:datetime", "demographic": "Seinen", "description": "Ever wondered what it would be like if your cat had to get a job? The cats in this book do every kind of occupation you can imagine, and they do it just the way they like. Feline chefs, dentists, wrestlers, detectives, opera singers and much more await in this hilarious full-color collection!", "format": "Full Color", @@ -49,7 +49,7 @@ __tests__ = ( "origin": "ja", "published": 2023, "publisher": (), - "rank": 29915, + "rank": range(29_000, 32_000), "rating": "safe", "score": float, "status": "Ongoing", @@ -94,9 +94,9 @@ __tests__ = ( "chapter_string": "aPu5CgJA-chapter-3-vi", "count": 20, "date": "dt:2025-05-09 17:25:38", - "date_updated": "dt:2025-06-21 18:25:55", + "date_updated": "type:datetime", "demographic": "Seinen", - "description": "\"Hey, wanna do it?\"\n\nA romantic comedy about living together with a scarred \"Queen\" in a relationship that’s more than friends but less than lovers!!\n\nOne late night, Yamamoto, a college student working part-time at a convenience store, reunites with Hayashi Megumi, his high school classmate and the most beautiful girl in their class.\nKnown as the \"Queen\" for her strong-willed and arrogant personality, Yamamoto had always found her difficult to get along with. However, during a routine conversation, he notices painful bruises on her wrist.\nAfter learning that her boyfriend had been abusing her, Yamamoto decides to let Hayashi stay at his place...!?", + "description": str, "format": "Adaptation", "genre": [ "Comedy", @@ -111,8 +111,8 @@ __tests__ = ( "lang": "vi", "links": { "al" : "187656", - "amz": "https://www.amazon.co.jp/-/en/dp/4088937163", - "bw" : "series/520105/list", + "amz": "https://www.amazon.co.jp/dp/B0F2SL834T", + "bw" : "series/520105", "mal": "178605", "raw": "https://manga.nicovideo.jp/comic/71123", }, @@ -120,21 +120,16 @@ __tests__ = ( "manga_hid": "oeb0Dydj", "manga_id": 114526, "manga_slug": "koko-jidai-ni-gomandatta-jou-sama-to-no-dousei-seikatsu-wa-igaito-igokochi-ga-warukunai", - "manga_titles": [ - "Cuộc sống chung với nữ hoàng từng kiêu ngạo hồi cấp ba, không ngờ lại khá dễ chịu.", - "高校時代に傲慢だった女王様との同棲生活は意外と居心地が悪くない", - "Koko Jidai Ni Gomandatta Jou Sama To No Dosei Seikatsu Ha Igaito Igokochi Ga Warukunai", - "Living together with the queen from my high school days who was arrogant, surprisingly isn't that uncomfortable", - ], - "mature": False, + "manga_titles": "len:list:4", + "mature": True, "origin": "ja", "published": 2025, - "publisher": (), - "rank": range(800, 1000), - "rating": "safe", + "publisher": ["Suiyoubi wa Mattari Dash X Comic"], + "rank": range(100, 1000), + "rating": "suggestive", "score": float, "status": "Ongoing", - "tags" : (), + "tags" : list, "theme": ["School Life"], "title": "Yamamoto \"Đuổi\" Hayashi Đi Ư!?", }, @@ -173,9 +168,26 @@ __tests__ = ( "https://comick.io/comic/koko-jidai-ni-gomandatta-jou-sama-to-no-dousei-seikatsu-wa-igaito-igokochi-ga-warukunai/rSROPoui-chapter-2-vi", "https://comick.io/comic/koko-jidai-ni-gomandatta-jou-sama-to-no-dousei-seikatsu-wa-igaito-igokochi-ga-warukunai/aPu5CgJA-chapter-3-vi", "https://comick.io/comic/koko-jidai-ni-gomandatta-jou-sama-to-no-dousei-seikatsu-wa-igaito-igokochi-ga-warukunai/eQ26SPqi-chapter-4-vi", + "https://comick.io/comic/koko-jidai-ni-gomandatta-jou-sama-to-no-dousei-seikatsu-wa-igaito-igokochi-ga-warukunai/nhtKNBiS-chapter-5-vi", + "https://comick.io/comic/koko-jidai-ni-gomandatta-jou-sama-to-no-dousei-seikatsu-wa-igaito-igokochi-ga-warukunai/1ukj8pOy-chapter-6-vi", ), "lang": "vi", }, +{ + "#url" : "https://comick.io/comic/kobayashi-san-chi-no-maid-dragon", + "#comment" : "'lang' option (#7938)", + "#class" : comick.ComickMangaExtractor, + "#options" : {"lang": ["fr", "id"]}, + "#pattern" : comick.ComickChapterExtractor.pattern, + "#results" : ( + "https://comick.io/comic/kobayashi-san-chi-no-maid-dragon/l0Mj1-chapter-1-id", + "https://comick.io/comic/kobayashi-san-chi-no-maid-dragon/xnkNn-chapter-1-fr", + "https://comick.io/comic/kobayashi-san-chi-no-maid-dragon/vw9Kn-chapter-2-id", + ), + + "lang": {"fr", "id"}, +}, + )