From 7a382de2f6384d3821658abcc095e9b637c9aee3 Mon Sep 17 00:00:00 2001 From: Robin Laevaert Date: Sun, 27 Feb 2022 15:41:44 +0100 Subject: [PATCH] Add better last episode checker --- GoGoDownloader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GoGoDownloader.py b/GoGoDownloader.py index b742acc..3309948 100644 --- a/GoGoDownloader.py +++ b/GoGoDownloader.py @@ -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.")