mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-06 11:54:51 +00:00
Fix
This commit is contained in:
parent
0328a370b3
commit
2280700563
1 changed files with 8 additions and 4 deletions
|
|
@ -3,6 +3,7 @@ import random
|
|||
import string
|
||||
import time
|
||||
import json
|
||||
import logging
|
||||
from http.cookies import SimpleCookie
|
||||
from urllib.parse import urlparse
|
||||
|
||||
|
|
@ -13,6 +14,8 @@ from misskaty.helper.http import http
|
|||
from misskaty.helper.human_read import get_readable_time
|
||||
from misskaty.plugins import ALL_MODULES
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
GENRES_EMOJI = {
|
||||
"Action": "👊",
|
||||
"Adventure": random.choice(["🪂", "🧗♀", "🌋"]),
|
||||
|
|
@ -98,10 +101,11 @@ def get_provider(url):
|
|||
|
||||
async def search_jw(movie_name: str, locale: str):
|
||||
m_t_ = ""
|
||||
response = await http.get(f"https://justwatch.imdbot.workers.dev/?q={movie_name}&L={locale}".format(
|
||||
q=movie_name,
|
||||
L=locale
|
||||
))
|
||||
try:
|
||||
response = await http.get(f"https://yasirapi.eu.org/justwatch?q={movie_name}&locale={locale}")
|
||||
except Exception as err:
|
||||
LOGGER.error("JustWatch API Error or got Rate Limited.")
|
||||
return m_t_
|
||||
soup = json.loads(response.text)
|
||||
items = soup["items"]
|
||||
for item in items:
|
||||
|
|
|
|||
Loading…
Reference in a new issue