Skip to content

Commit

Permalink
[komikcast] fix extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Sep 29, 2018
1 parent 8080071 commit 5507f5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
16 changes: 9 additions & 7 deletions gallery_dl/extractor/komikcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ def __init__(self, match):
ChapterExtractor.__init__(self, self.root + match.group(1))

def get_metadata(self, page):
info = text.extract(page, '<b>', "</b>")[0]
info = text.extract(page, '<title>', " - Komikcast</title>")[0]
return self.parse_chapter_string(info)

@staticmethod
def get_images(page):
readerarea = text.extract(
page, '<div id="readerarea">', '<div class="navig">')[0]
page, '<div class="lexot">', '</center>')[0]
return [
(text.unescape(url), {
"width": text.parse_int(width),
Expand Down Expand Up @@ -104,9 +104,11 @@ def chapters(self, page):
results = []
data = self.get_metadata(page)

page = text.extract(
page, "<span>Chapter List</span>", "<span>Download</span>")[0]
for item in text.extract_iter(
page, '<span class="leftoff"><a href="', '</a>'):
url, _, chapter_string = item.rpartition('">Chapter ')
page, ' href="', '" rel="'):
url, _, chapter_string = item.rpartition('" title="')
self.parse_chapter_string(chapter_string, data)
results.append((url, data.copy()))
return results
Expand All @@ -115,9 +117,9 @@ def chapters(self, page):
def get_metadata(page):
"""Return a dict with general metadata"""
manga , pos = text.extract(page, "<title>", "</title>")
author, pos = text.extract(page, "<th>Author</th><td>", "</td>", pos)
genres, pos = text.extract(page, "<th>Genres </th><td>", "</td>", pos)
mtype , pos = text.extract(page, "<th>Type </th><td>", "</td>", pos)
author, pos = text.extract(page, "<b>Author</b>: ", "</span>", pos)
genres, pos = text.extract(page, "<b>Genres </b>: ", "</span>", pos)
mtype , pos = text.extract(page, "<b>Type </b>: ", "</span>", pos)

return {
"manga": text.unescape(manga.rpartition(" - ")[0]),
Expand Down
1 change: 0 additions & 1 deletion test/test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
# temporary issues, etc.
BROKEN = {
"seaotterscans",
"komikcast",
}


Expand Down

0 comments on commit 5507f5c

Please sign in to comment.