[readcomiconline] improve comic-page parsing
This commit is contained in:
@@ -20,7 +20,6 @@ class ReadcomiconlineBase():
|
|||||||
filename_fmt = "{comic}_{issue:>03}_{page:>03}.{extension}"
|
filename_fmt = "{comic}_{issue:>03}_{page:>03}.{extension}"
|
||||||
archive_fmt = "{issue_id}_{page}"
|
archive_fmt = "{issue_id}_{page}"
|
||||||
root = "https://readcomiconline.to"
|
root = "https://readcomiconline.to"
|
||||||
useragent = "Wget/1.19.2 (linux-gnu)"
|
|
||||||
|
|
||||||
request = cloudflare.request_func
|
request = cloudflare.request_func
|
||||||
|
|
||||||
@@ -40,19 +39,22 @@ class ReadcomiconlineComicExtractor(ReadcomiconlineBase, MangaExtractor):
|
|||||||
"keyword": "f5ba5246cd787bb750924d9690cb1549199bd516",
|
"keyword": "f5ba5246cd787bb750924d9690cb1549199bd516",
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
scheme = "https"
|
|
||||||
|
|
||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
MangaExtractor.__init__(self, match, self.root + match.group(1))
|
MangaExtractor.__init__(self, match, self.root + match.group(1))
|
||||||
self.session.headers["User-Agent"] = self.useragent
|
|
||||||
|
|
||||||
def chapters(self, page):
|
def chapters(self, page):
|
||||||
results = []
|
results = []
|
||||||
comic, pos = text.extract(page, '<div class="heading"><h3>', '<')
|
comic, pos = text.extract(page, ' class="barTitle">', '<')
|
||||||
page , pos = text.extract(page, '<ul class="list">', '</ul>', pos)
|
page , pos = text.extract(page, ' class="listing">', '</table>', pos)
|
||||||
|
|
||||||
for item in text.extract_iter(page, '<a href="', '</span>'):
|
comic = comic.rpartition("information")[0].strip()
|
||||||
url, _, issue = item.partition('"><span>')
|
needle = ' title="Read {} '.format(comic)
|
||||||
|
comic = text.unescape(comic)
|
||||||
|
|
||||||
|
for item in text.extract_iter(page, ' href="', ' comic online '):
|
||||||
|
url, _, issue = item.partition(needle)
|
||||||
|
url = url.rpartition('"')[0]
|
||||||
if issue.startswith('Issue #'):
|
if issue.startswith('Issue #'):
|
||||||
issue = issue[7:]
|
issue = issue[7:]
|
||||||
results.append((self.root + url, {
|
results.append((self.root + url, {
|
||||||
@@ -76,7 +78,6 @@ class ReadcomiconlineIssueExtractor(ReadcomiconlineBase, ChapterExtractor):
|
|||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
ChapterExtractor.__init__(self, self.root + match.group(1))
|
ChapterExtractor.__init__(self, self.root + match.group(1))
|
||||||
self.issue_id = match.group(2)
|
self.issue_id = match.group(2)
|
||||||
self.session.headers["User-Agent"] = self.useragent
|
|
||||||
|
|
||||||
def get_metadata(self, page):
|
def get_metadata(self, page):
|
||||||
comic, pos = text.extract(page, " - Read\r\n ", "\r\n")
|
comic, pos = text.extract(page, " - Read\r\n ", "\r\n")
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ TRAVIS_SKIP = {
|
|||||||
# temporary issues, etc.
|
# temporary issues, etc.
|
||||||
BROKEN = {
|
BROKEN = {
|
||||||
"deviantart",
|
"deviantart",
|
||||||
"readcomiconline",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user