[mangatown] fix base url and simplify image extraction
This commit is contained in:
@@ -26,7 +26,7 @@ class MangatownChapterExtractor(MangatownBase, ChapterExtractor):
|
|||||||
|
|
||||||
def __init__(self, match):
|
def __init__(self, match):
|
||||||
self.part, self.volume, self.chapter = match.groups()
|
self.part, self.volume, self.chapter = match.groups()
|
||||||
self.base = f"{self.root}/manga/{self.part}/"
|
self.base = self.root + self.part + "/"
|
||||||
ChapterExtractor.__init__(self, match, self.base + "1.html")
|
ChapterExtractor.__init__(self, match, self.base + "1.html")
|
||||||
|
|
||||||
def metadata(self, page):
|
def metadata(self, page):
|
||||||
@@ -55,9 +55,8 @@ class MangatownChapterExtractor(MangatownBase, ChapterExtractor):
|
|||||||
pnum = 1
|
pnum = 1
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
url, pos = text.extract(page, 'id="image" src="', '"')
|
url = (text.extr(page, 'id="image" src="', '"') or
|
||||||
if not url:
|
text.extr(page, '<img src="', '"'))
|
||||||
url, pos = text.extract(page, '<img src="', '"')
|
|
||||||
if not url:
|
if not url:
|
||||||
return
|
return
|
||||||
yield text.ensure_http_scheme(url), None
|
yield text.ensure_http_scheme(url), None
|
||||||
|
|||||||
Reference in New Issue
Block a user