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]: Arreglado anime_info sin synopsis #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ target/
.idea/

# Sublime Text 2
*.sublime*
*.sublime*

# Virtualenv
.venv
8 changes: 5 additions & 3 deletions animeflv/animeflv.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ def get_anime_info(self, id: str) -> AnimeInfo:
response = self._scraper.get(f"{ANIME_URL}/{id}")
soup = BeautifulSoup(response.text, "lxml")

synopsis = soup.select_one(
"body div div div div div main section div.Description p"
).string

information = {
"title": soup.select_one(
"body div.Wrapper div.Body div div.Ficha.fchlt div.Container h1.Title"
Expand All @@ -295,9 +299,7 @@ def get_anime_info(self, id: str) -> AnimeInfo:
+ soup.select_one(
"body div div div div div aside div.AnimeCover div.Image figure img"
).get("src", ""),
"synopsis": soup.select_one(
"body div div div div div main section div.Description p"
).string.strip(),
"synopsis": synopsis.strip() if synopsis else None,
"rating": soup.select_one(
"body div div div.Ficha.fchlt div.Container div.vtshr div.Votes span#votes_prmd"
).string,
Expand Down