Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wordrain #2496

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 4 additions & 30 deletions sources/en/w/wordrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

logger = logging.getLogger(__name__)
search_url = "https://wordrain69.com/?s=%s"
post_chapter_url = "https://wordrain69.com/wp-admin/admin-ajax.php"
post_chapter_suffix = "/ajax/chapters/"


class WordRain(Crawler):
Expand All @@ -29,31 +29,6 @@ def initialize(self):
".sharedaddy",
]
)
self.cleaner.bad_text_regex.update(
[
"[The translation belongs to Wordrain. Support us by comments, ,"
+ " or buy Miao a coffee (*´ェ`*)っ旦~]",
"1 ko-Fi = extra chapter",
"[Thanks to everyone who’s reading this on wordrain. This translation "
+ "belongs to us. (•̀o•́)ง Support us by comments, , or buy Miao a coffee (´ェ`)っ旦~]",
"1 ko-fi= 1 bonus chapter.",
"[The translation belongs to Wordrain. Support us by comments, ,"
+ " or buy Miao a coffee (*´ェ`*)っ~]",
"1 ko fi = 1 extra chapter",
"[The translation belongs to Wordrain. Support us by comments, ,"
+ " or buy Miao a coffee (´ェ`)っ旦~]",
"[The translation belongs to Wordrain . Support us by comments, ,"
+ " or buy Miao a coffee (´ェ`)っ旦~]",
"[Thanks to everyone who are reading this on the site wordrain ."
+ " (•̀o•́)ง Support us by comments, , or buy Miao a coffee (´ェ`)っ旦~]",
"[Thanks to everyone who’s reading this on wordrain . "
+ "This translation belongs to us. (•̀o•́)ง Support us by comments, ,"
+ " or buy Miao a coffee (´ェ`)っ旦~]",
"[Thanks to everyone who’s reading this on wordrain ."
+ " This translation belongs to us. ( •̀o•́)ง Support us by comments, ,"
+ " or buy Miao a coffee ( ´ェ`)っ旦~]",
]
)

# NOTE: Site search doesn't work. So this won't work.
"""
Expand Down Expand Up @@ -97,15 +72,14 @@ def read_novel_info(self):
)
logger.info("%s", self.novel_author)

self.novel_id = soup.select_one(
".wp-manga-action-button[data-action=bookmark]"
)["data-post"]
self.novel_id = self.novel_url.removesuffix("/").split("/")[-1]
logger.info("Novel id: %s", self.novel_id)

post_chapter_url = f"{self.base_url[0]}/manga/{self.novel_id}{post_chapter_suffix}"

logger.info("Sending post request to %s", post_chapter_url)
response = self.submit_form(
post_chapter_url,
data={"action": "manga_get_chapters", "manga": int(self.novel_id)},
)
soup = self.make_soup(response)
for a in reversed(soup.select(".wp-manga-chapter > a")):
Expand Down