diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-04-12 12:58:40 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-04-12 12:58:40 +0200 |
commit | 404228d3b22886c0656ced8aa22e05dd6a14f60c (patch) | |
tree | a7f9a6bc1e5be5356865f1ac479c0f1fb21b0123 | |
parent | eaa0851500c111a0fe5a50bc3f8b5aa4354774db (diff) |
Use chapter names as is for mangatown
-rwxr-xr-x | plugins/mangatown.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/plugins/mangatown.py b/plugins/mangatown.py index 7092f9d..d3a7e04 100755 --- a/plugins/mangatown.py +++ b/plugins/mangatown.py @@ -65,24 +65,17 @@ def list_chapters(url, chapter_list_input): seen_urls.add(url) tree = etree.HTML(response.text) - items = [] + chapters = [] for element in tree.xpath('//ul[@class="chapter_list"]//a'): element_text = element.text.strip() url = element.attrib.get("href").strip() if "/manga/" not in url: continue url = "https://www.mangatown.com" + url - items.append((element_text, url)) - - chapter_num = len(items) - chapters = [] - for item in items: - element_text = "Ch. " + str(chapter_num) - chapter_num -= 1 - url = item[1] if element_text.lower().replace(" ", "") in seen_titles or url in seen_urls: break chapters.append({ "name": element_text, "url": url }) + print(json.dumps(chapters)) def is_only_num(s): |