-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/jmanga' into develop
- Loading branch information
Showing
4 changed files
with
72 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from typing import List | ||
|
||
from bs4.element import ResultSet, Tag | ||
|
||
from helpers.chapter import Chapter | ||
from helpers.checkers.base import AbstractChapterChecker | ||
|
||
|
||
class JmangaChecker(AbstractChapterChecker): | ||
"""Kunmanga checker""" | ||
|
||
URL_SUBSTRING = "jmanga" | ||
|
||
def get_latest_chapter_list(self) -> List[Chapter]: | ||
"""Get latest chapter list from Jmanga | ||
Returns: | ||
List[Chapter]: latest chapter list | ||
""" | ||
soup = self.get_latest_soup() | ||
if soup is None: | ||
return [] | ||
a_list: ResultSet[Tag] = soup.find_all("a", {"class": "item-link"}) | ||
chapter_list = [] | ||
for chapter_tag in a_list: | ||
chapter_title = chapter_tag.text.strip() | ||
chapter_url = chapter_tag["href"] | ||
chapter_list.append(Chapter(title=chapter_title, url=chapter_url)) | ||
|
||
return chapter_list[::-1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters