[32] fix imdb_watchlist

pull/1894/head
meisnate12 9 months ago
parent 428dbe6ba2
commit c75e017009

@ -1 +1 @@
1.20.0-develop31
1.20.0-develop32

@ -189,9 +189,10 @@ class IMDb:
def _watchlist(self, user, language):
imdb_url = f"{base_url}/user/{user}/watchlist"
group = self._request(imdb_url, language=language, xpath="//span[@class='ab_widget']/script[@type='text/javascript']/text()")
if group:
return [k for k in json.loads(str(group[0]).split("\n")[5][35:-2])["titles"]]
for text in self._request(imdb_url, language=language , xpath="//div[@class='article']/script/text()")[0].split("\n"):
if text.strip().startswith("IMDbReactInitialState.push"):
jsonline = text.strip()
return [f for f in json.loads(jsonline[jsonline.find('{'):-2])["starbars"]]
raise Failed(f"IMDb Error: Failed to parse URL: {imdb_url}")
def _total(self, imdb_url, language):

Loading…
Cancel
Save