imdb: fix unrated content
This commit is contained in:
parent
7854e8628f
commit
144551a232
@ -27,8 +27,8 @@ def get_movie_by_id(imdbid):
|
||||
"Title": soup.body.find('h1').contents[0].strip(),
|
||||
"Year": soup.body.find(id="titleYear").find("a").text.strip() if soup.body.find(id="titleYear") else ", ".join([y.text.strip() for y in soup.body.find(attrs={"class": "seasons-and-year-nav"}).find_all("a")[1:]]),
|
||||
"Duration": soup.body.find(attrs={"class": "title_wrapper"}).find("time").text.strip() if soup.body.find(attrs={"class": "title_wrapper"}).find("time") else None,
|
||||
"imdbRating": soup.body.find(attrs={"class": "ratingValue"}).find("strong").text.strip(),
|
||||
"imdbVotes": soup.body.find(attrs={"class": "imdbRating"}).find("a").text.strip(),
|
||||
"imdbRating": soup.body.find(attrs={"class": "ratingValue"}).find("strong").text.strip() if soup.body.find(attrs={"class": "ratingValue"}) else None,
|
||||
"imdbVotes": soup.body.find(attrs={"class": "imdbRating"}).find("a").text.strip() if soup.body.find(attrs={"class": "imdbRating"}) else None,
|
||||
"Plot": re.sub(r"\s+", " ", soup.body.find(attrs={"class": "summary_text"}).text).strip(),
|
||||
|
||||
"Type": "TV Series" if soup.find(id="title-episode-widget") else "Movie",
|
||||
|
Loading…
Reference in New Issue
Block a user