Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
- Fix errore funzione find (casualmente animeworld ritorna errore)
- Fix Exception AnimeNotAvailable
  • Loading branch information
MainKronos committed Apr 12, 2022
1 parent 393058b commit 82577d4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion animeworld/anime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
4 changes: 3 additions & 1 deletion animeworld/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 82577d4

Please sign in to comment.