Merge pull request #6 from RobinLaevaert/AddBetterLastEpisodeChecker

Add better last episode checker
This commit is contained in:
Karl Hudgell 2022-02-28 09:20:17 +00:00 committed by GitHub
commit 093437f464
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,7 +50,7 @@ def gogodownloader(config):
if res.status_code == 200:
soup = BeautifulSoup(res.content, "html.parser")
all_episodes = soup.find("ul", {"id": "episode_page"})
all_episodes = int(all_episodes.get_text().split("-")[-1].strip())
all_episodes = int(list(filter(None, "-".join(all_episodes.get_text().splitlines()).split("-")))[-1].strip())
break
else:
print(f"{ERR}Error 404: Anime not found. Please try again.")