Repos / pytaku / 389a7cf776
commit 389a7cf776e86f3839a180b2accb4620888ec720
Author: Bùi Thành Nhân <hi@imnhan.com>
Date: Tue Aug 11 21:41:09 2020 +0700
mangasee descriptions
diff --git a/src/mangoapi/mangasee.py b/src/mangoapi/mangasee.py
index ac96f69..0df9a00 100644
--- a/src/mangoapi/mangasee.py
+++ b/src/mangoapi/mangasee.py
@@ -9,6 +9,9 @@
regexes = {
"title_name": re.compile(r"<title>\s*([^|]+) | MangaSee</title>"),
"title_chapters": re.compile(r"vm\.Chapters = (\[[^\]]+\])"),
+ "title_desc": re.compile(
+ r"<span +class=\"mlabel\">Description:</span>[^<]+<div[^>]*>([^<]+)<"
+ ),
"chapter_title_name": re.compile(r'vm\.IndexName = "([^"]+)"'),
"chapter_data": re.compile(r"vm\.CurChapter = (\{[^\}]+\})"),
"chapter_img_server": re.compile(r'vm\.CurPathName = "([^"]+)"'),
@@ -26,6 +29,7 @@ def get_title(self, title_id):
assert resp.status_code == 200
html = resp.text
name = regexes["title_name"].search(html).group(1).strip()
+ desc = regexes["title_desc"].search(html).group(1).strip()
chapters_str = regexes["title_chapters"].search(html).group(1)
chapters = []
for ch in json.loads(chapters_str):
@@ -46,7 +50,7 @@ def get_title(self, title_id):
"cover_ext": "jpg",
"chapters": chapters,
"alt_names": [],
- "descriptions": [],
+ "descriptions": [desc],
}
def get_chapter(self, title_id, chapter_id):