Skip to content

Commit

Permalink
[komikcast] fix 'manga' extractor (#5027)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jan 6, 2024
1 parent 8e1a2b5 commit c25bdba
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
6 changes: 4 additions & 2 deletions gallery_dl/extractor/komikcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ def chapters(self, page):

for item in text.extract_iter(
page, '<a class="chapter-link-item" href="', '</a'):
url, _, chapter_string = item.rpartition('">Chapter ')
self.parse_chapter_string(chapter_string, data)
url, _, chapter = item.rpartition('">Chapter')
chapter, sep, minor = chapter.strip().partition(".")
data["chapter"] = text.parse_int(chapter)
data["chapter_minor"] = sep + minor
results.append((url, data.copy()))
return results

Expand Down
18 changes: 16 additions & 2 deletions test/results/komikcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,22 @@
"#url" : "https://komikcast.site/komik/090-eko-to-issho/",
"#category": ("", "komikcast", "manga"),
"#class" : komikcast.KomikcastMangaExtractor,
"#sha1_url" : "19d3d50d532e84be6280a3d61ff0fd0ca04dd6b4",
"#sha1_metadata": "837a7e96867344ff59d840771c04c20dc46c0ab1",
"#pattern" : komikcast.KomikcastChapterExtractor.pattern,
"#count" : 12,

"author" : "Asakura Maru",
"chapter": range(1, 12),
"chapter_minor": "",
"genres" : [
"Comedy",
"Drama",
"Romance",
"School Life",
"Sci-Fi",
"Shounen"
],
"manga" : "090 Eko to Issho",
"type" : "Manga",
},

{
Expand Down

0 comments on commit c25bdba

Please sign in to comment.