diff --git a/wibuapi/wibuapi_async.py b/wibuapi/wibuapi_async.py index 97a7348..b23b629 100644 --- a/wibuapi/wibuapi_async.py +++ b/wibuapi/wibuapi_async.py @@ -5,15 +5,16 @@ class AsyncWibuAPI: - def __init__(self): - self.base_url = "https://wibu-api.eu.org/api" - self.deprecated_url = "https://api.wibu-api.eu.org/api" + def __init__(self, apikey=None): + self.base_url = "https://wibu-api.eu.org" + self.deprecated_url = "https://api.wibu-api.eu.org" + self.headers = {"x-wibu-key": apikey} # Anime, Donghua, Hentai async def lendrive(self, link: str): try: url = f"{self.base_url}/anime/lendrive?link={link}" - return await getwibu(url, timeout=15) + return await getwibu(url, headers=self.headers, timeout=15) except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport"