[readcomiconline] fix extraction
This commit is contained in:
@@ -80,21 +80,20 @@ class ReadcomiconlineIssueExtractor(ReadcomiconlineBase, ChapterExtractor):
|
|||||||
def images(self, page):
|
def images(self, page):
|
||||||
results = []
|
results = []
|
||||||
referer = {"_http_headers": {"Referer": self.page_url}}
|
referer = {"_http_headers": {"Referer": self.page_url}}
|
||||||
root = text.extr(page, "return baeu(l, '", "'")
|
root, pos = text.extract(page, "return baeu(l, '", "'")
|
||||||
|
_ , pos = text.extract(page, "var pth = '", "", pos)
|
||||||
|
var , pos = text.extract(page, "var ", "= '", pos)
|
||||||
|
|
||||||
replacements = re.findall(
|
replacements = re.findall(
|
||||||
r"l = l\.replace\(/([^/]+)/g, [\"']([^\"']*)", page)
|
r"l = l\.replace\(/([^/]+)/g, [\"']([^\"']*)", page)
|
||||||
|
|
||||||
for block in page.split("\t\tpht = '")[1:]:
|
for path in page.split(var)[2:]:
|
||||||
pth = text.extr(block, "", "'")
|
path = text.extr(path, "= '", "'")
|
||||||
|
|
||||||
for needle, repl in re.findall(
|
|
||||||
r"pth = pth\.replace\(/([^/]+)/g, [\"']([^\"']*)", block):
|
|
||||||
pth = pth.replace(needle, repl)
|
|
||||||
for needle, repl in replacements:
|
for needle, repl in replacements:
|
||||||
pth = pth.replace(needle, repl)
|
path = path.replace(needle, repl)
|
||||||
|
|
||||||
results.append((baeu(pth, root), referer))
|
results.append((baeu(path, root), referer))
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ __tests__ = (
|
|||||||
"#category": ("", "readcomiconline", "comic"),
|
"#category": ("", "readcomiconline", "comic"),
|
||||||
"#class" : readcomiconline.ReadcomiconlineComicExtractor,
|
"#class" : readcomiconline.ReadcomiconlineComicExtractor,
|
||||||
"#sha1_url" : "74eb8b9504b4084fcc9367b341300b2c52260918",
|
"#sha1_url" : "74eb8b9504b4084fcc9367b341300b2c52260918",
|
||||||
"#sha1_metadata": "3986248e4458fa44a201ec073c3684917f48ee0c",
|
"#sha1_metadata": "574051aaf7a5c92dafed9e94baa40a1a93db5c90",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -30,7 +30,7 @@ __tests__ = (
|
|||||||
"#category": ("", "readcomiconline", "comic"),
|
"#category": ("", "readcomiconline", "comic"),
|
||||||
"#class" : readcomiconline.ReadcomiconlineComicExtractor,
|
"#class" : readcomiconline.ReadcomiconlineComicExtractor,
|
||||||
"#sha1_url" : "2f66a467a772df4d4592e97a059ddbc3e8991799",
|
"#sha1_url" : "2f66a467a772df4d4592e97a059ddbc3e8991799",
|
||||||
"#sha1_metadata": "f5ba5246cd787bb750924d9690cb1549199bd516",
|
"#sha1_metadata": "9563a19454e1b4e0da5b7a28112bf00a3e8069a8",
|
||||||
},
|
},
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user