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

[webtoons] extract 'episode_no' for comic results (#6439)

This commit is contained in:
Mike Fährmann 2024-11-08 14:16:54 +01:00
parent 77f761d320
commit b6cf348658
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 20 additions and 3 deletions

View File

@ -155,7 +155,10 @@ class WebtoonsComicExtractor(WebtoonsBase, Extractor):
def items(self): def items(self):
page = None page = None
data = {"_extractor": WebtoonsEpisodeExtractor} data = {
"_extractor": WebtoonsEpisodeExtractor,
"title_no" : text.parse_int(self.title_no),
}
while True: while True:
path = "/{}/list?title_no={}&page={}".format( path = "/{}/list?title_no={}&page={}".format(
@ -173,6 +176,8 @@ class WebtoonsComicExtractor(WebtoonsBase, Extractor):
data["page"] = self.page_no data["page"] = self.page_no
for url in self.get_episode_urls(page): for url in self.get_episode_urls(page):
params = text.parse_query(url.rpartition("?")[2])
data["episode_no"] = text.parse_int(params.get("episode_no"))
yield Message.Queue, url, data yield Message.Queue, url, data
self.page_no += 1 self.page_no += 1

View File

@ -99,15 +99,23 @@ __tests__ = (
"#class" : webtoons.WebtoonsComicExtractor, "#class" : webtoons.WebtoonsComicExtractor,
"#pattern" : webtoons.WebtoonsEpisodeExtractor.pattern, "#pattern" : webtoons.WebtoonsEpisodeExtractor.pattern,
"#range" : "1-15", "#range" : "1-15",
"#count" : ">= 15", "#count" : ">= 14",
"page" : range(1, 2),
"title_no" : 919,
"episode_no": range(1, 14),
}, },
{ {
"#url" : "https://www.webtoons.com/fr/romance/subzero/list?title_no=1845&page=3", "#url" : "https://www.webtoons.com/fr/romance/subzero/list?title_no=1845&page=7",
"#comment" : "french", "#comment" : "french",
"#category": ("", "webtoons", "comic"), "#category": ("", "webtoons", "comic"),
"#class" : webtoons.WebtoonsComicExtractor, "#class" : webtoons.WebtoonsComicExtractor,
"#count" : ">= 15", "#count" : ">= 15",
"page" : range(7, 25),
"title_no" : 1845,
"episode_no": int,
}, },
{ {
@ -116,6 +124,10 @@ __tests__ = (
"#category": ("", "webtoons", "comic"), "#category": ("", "webtoons", "comic"),
"#class" : webtoons.WebtoonsComicExtractor, "#class" : webtoons.WebtoonsComicExtractor,
"#count" : ">= 18", "#count" : ">= 18",
"page" : int,
"title_no" : 210827,
"episode_no": int,
}, },
{ {