[webtoons] extract 'episode_no' for comic results (#6439)
This commit is contained in:
@@ -155,7 +155,10 @@ class WebtoonsComicExtractor(WebtoonsBase, Extractor):
|
||||
|
||||
def items(self):
|
||||
page = None
|
||||
data = {"_extractor": WebtoonsEpisodeExtractor}
|
||||
data = {
|
||||
"_extractor": WebtoonsEpisodeExtractor,
|
||||
"title_no" : text.parse_int(self.title_no),
|
||||
}
|
||||
|
||||
while True:
|
||||
path = "/{}/list?title_no={}&page={}".format(
|
||||
@@ -173,6 +176,8 @@ class WebtoonsComicExtractor(WebtoonsBase, Extractor):
|
||||
data["page"] = self.page_no
|
||||
|
||||
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
|
||||
|
||||
self.page_no += 1
|
||||
|
||||
@@ -99,15 +99,23 @@ __tests__ = (
|
||||
"#class" : webtoons.WebtoonsComicExtractor,
|
||||
"#pattern" : webtoons.WebtoonsEpisodeExtractor.pattern,
|
||||
"#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",
|
||||
"#category": ("", "webtoons", "comic"),
|
||||
"#class" : webtoons.WebtoonsComicExtractor,
|
||||
"#count" : ">= 15",
|
||||
|
||||
"page" : range(7, 25),
|
||||
"title_no" : 1845,
|
||||
"episode_no": int,
|
||||
},
|
||||
|
||||
{
|
||||
@@ -116,6 +124,10 @@ __tests__ = (
|
||||
"#category": ("", "webtoons", "comic"),
|
||||
"#class" : webtoons.WebtoonsComicExtractor,
|
||||
"#count" : ">= 18",
|
||||
|
||||
"page" : int,
|
||||
"title_no" : 210827,
|
||||
"episode_no": int,
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user