diff --git a/animeworld/anime.py b/animeworld/anime.py index bebc87b..6d98dfe 100644 --- a/animeworld/anime.py +++ b/animeworld/anime.py @@ -188,7 +188,10 @@ def getEpisodes(self) -> List[Episodio]: # Ritorna una lista di Episodi """ soupeddata = BeautifulSoup(self.html, "html.parser") - self.link = "https://www.animeworld.tv" + soupeddata.select_one('li.episode > a').get('href') + a_link = soupeddata.select_one('li.episode > a') + if a_link is None: raise AnimeNotAvailable(self.getName()) + + self.link = "https://www.animeworld.tv" + a_link.get('href') soupeddata = BeautifulSoup(self.__getHTML().content, "html.parser") diff --git a/animeworld/utility.py b/animeworld/utility.py index 7a4bdff..7483487 100644 --- a/animeworld/utility.py +++ b/animeworld/utility.py @@ -79,7 +79,9 @@ def find(keyword: str) -> List[Dict]: res = requests.post("https://www.animeworld.tv/api/search/v2?", params = {"keyword": keyword} ,headers=myHDR, cookies=cookies) - data = res.json()["animes"] + data = res.json() + if "error" in data: return [] + data = data["animes"] data.sort(key=lambda a: a["dub"]) return [ diff --git a/setup.py b/setup.py index 96a1f67..80326f8 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="animeworld", - version="1.4.13", + version="1.4.14", author="MainKronos", description="AnimeWorld UNOFFICIAL API", long_description=long_description,