mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-06 20:04:51 +00:00
[IMDB Search] Changed Code With Justwatch GraphQL Since Old Public Proxy Has Dead
Signed-off-by: Yasir Aris M <git@yasirdev.my.id>
This commit is contained in:
parent
0cdcef3ebd
commit
2a4d9070af
1 changed files with 13 additions and 13 deletions
|
|
@ -5,6 +5,7 @@ import string
|
||||||
import time
|
import time
|
||||||
from http.cookies import SimpleCookie
|
from http.cookies import SimpleCookie
|
||||||
from re import match as re_match
|
from re import match as re_match
|
||||||
|
from typing import Union
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
import psutil
|
import psutil
|
||||||
|
|
@ -137,12 +138,11 @@ async def search_jw(movie_name: str, locale: str):
|
||||||
if not response.get("results"):
|
if not response.get("results"):
|
||||||
LOGGER.error("JustWatch API Error or got Rate Limited.")
|
LOGGER.error("JustWatch API Error or got Rate Limited.")
|
||||||
return m_t_
|
return m_t_
|
||||||
for item in response.get("results")["items"]:
|
for item in response["results"]["data"]["popularTitles"]["edges"]:
|
||||||
if movie_name == item.get("title", ""):
|
if item["node"]["content"]["title"] == movie_name:
|
||||||
offers = item.get("offers", [])
|
|
||||||
t_m_ = []
|
t_m_ = []
|
||||||
for offer in offers:
|
for offer in item["node"].get("offers", []):
|
||||||
url = offer.get("urls").get("standard_web")
|
url = offer["standardWebURL"]
|
||||||
if url not in t_m_:
|
if url not in t_m_:
|
||||||
p_o = get_provider(url)
|
p_o = get_provider(url)
|
||||||
m_t_ += f"<a href='{url}'>{p_o}</a> | "
|
m_t_ += f"<a href='{url}'>{p_o}</a> | "
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue