From c25bdbae91f172112b5be7f1ea926ed07ac0c370 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= <mike_faehrmann@web.de>
Date: Sat, 6 Jan 2024 14:19:44 +0100
Subject: [PATCH] [komikcast] fix 'manga' extractor (#5027)

---
 gallery_dl/extractor/komikcast.py |  6 ++++--
 test/results/komikcast.py         | 18 ++++++++++++++++--
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/gallery_dl/extractor/komikcast.py b/gallery_dl/extractor/komikcast.py
index 53411a2edc..7a19be5001 100644
--- a/gallery_dl/extractor/komikcast.py
+++ b/gallery_dl/extractor/komikcast.py
@@ -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
 
diff --git a/test/results/komikcast.py b/test/results/komikcast.py
index 89fcbf10d3..fa35c95f17 100644
--- a/test/results/komikcast.py
+++ b/test/results/komikcast.py
@@ -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",
 },
 
 {