diff --git a/README.md b/README.md index 6b2dd2f..7a58931 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ _Official Python Wrapper for Wibu API._ [![wibu-api-py](https://socialify.git.ci/zYxDevs/wibu-api-py/image?description=1&font=Source%20Code%20Pro&forks=1&issues=1&language=1&logo=https%3A%2F%2F1000logos.net%2Fwp-content%2Fuploads%2F2021%2F04%2FTelegram-logo.png&owner=1&pattern=Plus&pulls=1&stargazers=1&theme=Light)](https://t.me/SpreadNetworks) +[![Repobeats](https://repobeats.axiom.co/api/embed/364ba56848b827421280d052516d543e9515cb2e.svg "Repobeats analytics image")](https://t.me/WibuAPIBot) + ## How to install #### Use pip ``` @@ -31,14 +33,14 @@ _There's many useful features in bot but it required big resource, so i make it **Paid Features:** -- [x] All features on WibuAPI +- [x] Everything on WibuAPI - [x] LH Translation ziper - [x] Shinigami ziper - [x] Worldmanhwas ziper - [x] Maid Manga ziper - [x] Mangayaro ziper - [x] Cosmicscans ziper -- [x] nHentai ziper +- [x] nHentai, nHentai.to, Hentaifox, AsmHentai, Pururin ziper - [x] Sheakomik, Sheamanga ziper - [x] Komikindo.info ziper - [x] Mikoroku ziper @@ -46,6 +48,9 @@ _There's many useful features in bot but it required big resource, so i make it - [x] OnlyWaifu ziper - [x] Manhwatop ziper - [x] Manhuafast ziper +- [x] Drakescans ziper +- [x] Omegascans ziper +- [x] Telegra.ph ziper - [x] Onlylama - [x] Download link scraper - [x] Photo album ziper @@ -55,6 +60,10 @@ _There's many useful features in bot but it required big resource, so i make it - [x] Javhd - [x] Search parser - [x] Download link scraper +- [x] Rule34 downloader +- [x] Bunkrr.su downloader +- [x] NudeCosplayGirl ziper +- [x] Mirrored scraper - [x] Other incoming features [![WibuAPI Bot](https://img.shields.io/badge/WibuAPI-Bot-blue?&logo=telegram)](https://wibuapibot.t.me) diff --git a/wibuapi/utils.py b/wibuapi/utils.py index 4c261d3..43aad85 100644 --- a/wibuapi/utils.py +++ b/wibuapi/utils.py @@ -4,8 +4,8 @@ import aiohttp -async def getwibu(url: str, timeout: int): +async def getwibu(url: str, headers, timeout: int): async with aiohttp.ClientSession() as session: - async with session.get(url, timeout=timeout) as response: + async with session.get(url, headers=headers, timeout=timeout) as response: response.raise_for_status() return await response.json() diff --git a/wibuapi/wibuapi.py b/wibuapi/wibuapi.py index 19fab10..02e3b5a 100644 --- a/wibuapi/wibuapi.py +++ b/wibuapi/wibuapi.py @@ -5,92 +5,93 @@ class WibuAPI: - def __init__(self): - self.base_url = "https://weebsapi.onrender.com/api" + def __init__(self, apikey: str = ""): + self.base_url = "https://wibu-api.eu.org/api" self.deprecated_url = "https://api.wibu-api.eu.org/api" + self.headers = {"x-wibu-key": apikey} # Anime, Donghua, Hentai def lendrive(self, link: str): try: url = f"{self.base_url}/anime/lendrive?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def donghua(self, link: str): try: url = f"{self.base_url}/anime/donghua?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def anixlife(self, link: str): try: url = f"{self.base_url}/anime/anixlife?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def kazefuri(self, link: str): try: url = f"{self.base_url}/anime/kazefuri?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def anichin(self, link: str): try: url = f"{self.base_url}/anime/anichin?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def nekopoi(self, link: str): try: url = f"{self.base_url}/anime/nekopoi?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def hentaiguru(self, link: str): try: url = f"{self.base_url}/anime/hentaiguru?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def kusonime(self, link: str): try: url = f"{self.base_url}/anime/kusonime?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def doronime(self, link: str): try: url = f"{self.base_url}/anime/doronime?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def samehadaku(self, link: str): try: url = f"{self.base_url}/anime/samehadaku?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def kuramanime(self, link: str): try: url = f"{self.base_url}/anime/kuramanime?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def moenime(self, link: str): try: url = f"{self.base_url}/anime/moenime?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -98,70 +99,70 @@ def moenime(self, link: str): def rawkuma(self, link: str): try: url = f"{self.base_url}/manga/rawkuma?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def yumekomik(self, link: str): try: url = f"{self.base_url}/manga/yumekomik?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def westmanga(self, link: str): try: url = f"{self.base_url}/manga/westmanga?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def komikindo(self, link: str): try: url = f"{self.base_url}/manga/komikindo?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def mangatale(self, link: str): try: url = f"{self.base_url}/manga/mangatale?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def kiryuu(self, link: str): try: url = f"{self.base_url}/manga/kiryuu?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def masterkomik(self, link: str): try: url = f"{self.base_url}/manga/masterkomik?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def mangakita(self, link: str): try: url = f"{self.base_url}/manga/mangakita?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def doujindesu(self, link: str): try: url = f"{self.base_url}/manga/doudesu?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def crotpedia(self, link: str): try: url = f"{self.base_url}/manga/crotpedia?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -169,21 +170,21 @@ def crotpedia(self, link: str): def wibusubs(self, link: str): try: url = f"{self.base_url}/drama/wibusubs?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def adikfilm(self, link: str): try: url = f"{self.base_url}/film/adikfilm?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def mydramalist_search(self, query: str): try: url = f"{self.base_url}/drama/search?query={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -191,28 +192,28 @@ def mydramalist_search(self, query: str): def novelupdates_search(self, query: str): try: url = f"{self.base_url}/novel/novelupdates/search?query={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def noveltoon_search(self, query: str, language: str): try: url = f"{self.base_url}/novel/noveltoon/search?query={query}&language={language}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def noveltoon_chapter(self, link: str): try: url = f"{self.base_url}/novel/noveltoon/chapter?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def noveltoon_read(self, link: str): try: url = f"{self.base_url}/novel/noveltoon/read?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -220,21 +221,21 @@ def noveltoon_read(self, link: str): def sukidesuost_search(self, query: str, page: int): try: url = f"{self.base_url}/music/sukidesuost/search?query={query}&page={page}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def sukidesuost(self, link: str): try: url = f"{self.base_url}/music/sukidesuost?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def hikarinoakari(self, link: str): try: url = f"{self.base_url}/music/hikarinoakari?link={link}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -242,14 +243,14 @@ def hikarinoakari(self, link: str): def google(self, query: str): try: url = f"{self.base_url}/google/search?query={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def lk21(self, query: str): try: url = f"{self.base_url}/lk21/search?title={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -257,7 +258,7 @@ def lk21(self, query: str): def yandex_reverse_image(self, image_url: str): try: url = f"{self.base_url}/yandex/reverse_image?image_url={image_url}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -265,7 +266,7 @@ def yandex_reverse_image(self, image_url: str): def anilyrics_search(self, query: str): try: url = f"{self.base_url}/anime/lyrics/search?query={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -275,70 +276,66 @@ def anilyrics(self, link: str, type: str): """ try: url = f"{self.base_url}/anime/lyrics?link={link}&type={type}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def lyrics(self, query: str): try: url = f"{self.base_url}/lyrics/search?query={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" # Anipics, Porn, JAV, Booru - def anipics(self, category: str, tags: str): - if category not in ("nsfw"): - return f"Category {category} is unknown. Available category: nsfw" - if tags not in ("ahegao", "waifu", "neko", "trap", "bj"): - return ( - f"Tags {tags} is unknown. Available tags: ahegao, waifu, neko, trap, bj" - ) + def anipics(self, tags: str, category: str): + if tags not in ("sfw", "nsfw"): + return f"Tags {tags} is unknown. Available tags: sfw, nsfw" try: - url = f"{self.base_url}/anime/{category}/{tags}" - return get(url, timeout=15).json() + url = f"{self.base_url}/animepics/{tags}/{category}" + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def jav(self): try: url = f"{self.base_url}/porn/jav" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def porn_gif(self): try: url = f"{self.base_url}/porn/gif" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def realbooru_nsfw(self): try: url = f"{self.base_url}/booru/nsfw/rb" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def gelbooru_nsfw(self): try: url = f"{self.base_url}/booru/nsfw/gb" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def gelbooru_sfw(self): try: url = f"{self.base_url}/booru/sfw/gb" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def safebooru_sfw(self): try: url = f"{self.base_url}/booru/sfw/sb" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -346,42 +343,42 @@ def safebooru_sfw(self): def giUser(self, uid: int): try: url = f"{self.base_url}/game/gi/user?uid={uid}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def giWeapon(self, query: str): try: url = f"{self.base_url}/game/gi/weapon?name={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def giEnemy(self, query: str): try: url = f"{self.base_url}/game/gi/enemy?name={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def giElement(self, query: str): try: url = f"{self.base_url}/game/gi/element?name={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def giCharacter(self, query: str): try: url = f"{self.base_url}/game/gi/character?name={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def giArtifact(self, query: str): try: url = f"{self.base_url}/game/gi/artifact?name={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -392,7 +389,7 @@ def brawlClub(self, tag: str): tag = f"%23{tag}" tag = tag.replace("#", "%23") url = f"{self.deprecated_url}/game/brawl/club?clubTag={tag}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -402,14 +399,14 @@ def brawlClubMember(self, tag: str): tag = f"%23{tag}" tag = tag.replace("#", "%23") url = f"{self.deprecated_url}/game/brawl/club/member?clubTag={tag}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def brawlEvent(self): try: url = f"{self.deprecated_url}/game/brawl/event" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -419,7 +416,7 @@ def brawlPlayer(self, tag: str): tag = f"%23{tag}" tag = tag.replace("#", "%23") url = f"{self.deprecated_url}/game/brawl/player?playerTag={tag}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -429,7 +426,7 @@ def brawlPlayerLog(self, tag: str): tag = f"%23{tag}" tag = tag.replace("#", "%23") url = f"{self.deprecated_url}/game/brawl/player/log?playerTag={tag}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -437,7 +434,7 @@ def brawlPlayerLog(self, tag: str): def ud(self, query: str): try: url = f"{self.base_url}/etc/ud?query={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -446,7 +443,7 @@ def youtube(self, url: str): """https://www.youtube.com/watch?v=a1V0UbBNliM""" try: url = f"{self.base_url}/etc/youtube?url={url}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -454,21 +451,21 @@ def facebook(self, url: str): """https://www.facebook.com/groups/247539486825123/permalink/628642412048160""" try: url = f"{self.base_url}/etc/facebook?url={url}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def device(self, query: str): try: url = f"{self.base_url}/etc/gsm/search?query={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def slug(self, query: str): try: url = f"{self.base_url}/etc/gsm/slug?query={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -476,14 +473,14 @@ def slug(self, query: str): def b64encode(self, query: str): try: url = f"{self.base_url}/encode/base64?query={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def b64decode(self, query: str): try: url = f"{self.base_url}/decode/base64?query={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -491,21 +488,21 @@ def b64decode(self, query: str): def ip_lookup(self, ip: str): try: url = f"{self.base_url}/lookup/ip?ip={ip}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def pypi_search(self, query: str, page: int): try: url = f"{self.base_url}/pypi/search?query={query}&page={page}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def npm_search(self, query: str): try: url = f"{self.base_url}/npm/search?query={query}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -513,7 +510,7 @@ def npm_search(self, query: str): def terabox(self, url: str): try: url = f"{self.base_url}/bypass/terabox?url={url}" - return get(url, timeout=15).json() + return get(url, headers=self.headers, timeout=15).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" @@ -521,13 +518,13 @@ def terabox(self, url: str): def bard(self, query: str, cookie: str = ""): try: url = f"{self.base_url}/chatbot/bard?query={query}&cookie={cookie}" - return get(url, timeout=50).json() + return get(url, headers=self.headers, timeout=50).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" def gpt(self, query: str, gpt_key: str = ""): try: url = f"{self.base_url}/chatbot/gpt?query={query}&gpt_key={gpt_key}" - return get(url, timeout=50).json() + return get(url, headers=self.headers, timeout=50).json() except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" diff --git a/wibuapi/wibuapi_async.py b/wibuapi/wibuapi_async.py index 8c0fe76..ab34ed0 100644 --- a/wibuapi/wibuapi_async.py +++ b/wibuapi/wibuapi_async.py @@ -5,92 +5,93 @@ class AsyncWibuAPI: - def __init__(self): - self.base_url = "https://weebsapi.onrender.com/api" + def __init__(self, apikey: str = ""): + self.base_url = "https://wibu-api.eu.org/api" self.deprecated_url = "https://api.wibu-api.eu.org/api" + 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" async def donghua(self, link: str): try: url = f"{self.base_url}/anime/donghua?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" async def anixlife(self, link: str): try: url = f"{self.base_url}/anime/anixlife?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" async def kazefuri(self, link: str): try: url = f"{self.base_url}/anime/kazefuri?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" async def anichin(self, link: str): try: url = f"{self.base_url}/anime/anichin?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" async def nekopoi(self, link: str): try: url = f"{self.base_url}/anime/nekopoi?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" async def hentaiguru(self, link: str): try: url = f"{self.base_url}/anime/hentaiguru?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" async def kusonime(self, link: str): try: url = f"{self.base_url}/anime/kusonime?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" async def doronime(self, link: str): try: url = f"{self.base_url}/anime/doronime?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" async def samehadaku(self, link: str): try: url = f"{self.base_url}/anime/samehadaku?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" async def kuramanime(self, link: str): try: url = f"{self.base_url}/anime/kuramanime?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" async def moenime(self, link: str): try: url = f"{self.base_url}/anime/moenime?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" @@ -98,70 +99,70 @@ async def moenime(self, link: str): async def rawkuma(self, link: str): try: url = f"{self.base_url}/manga/rawkuma?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" async def yumekomik(self, link: str): try: url = f"{self.base_url}/manga/yumekomik?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" async def westmanga(self, link: str): try: url = f"{self.base_url}/manga/westmanga?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" async def komikindo(self, link: str): try: url = f"{self.base_url}/manga/komikindo?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" async def mangatale(self, link: str): try: url = f"{self.base_url}/manga/mangatale?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" async def kiryuu(self, link: str): try: url = f"{self.base_url}/manga/kiryuu?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" async def masterkomik(self, link: str): try: url = f"{self.base_url}/manga/masterkomik?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" async def mangakita(self, link: str): try: url = f"{self.base_url}/manga/mangakita?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" async def doujindesu(self, link: str): try: url = f"{self.base_url}/manga/doudesu?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" async def crotpedia(self, link: str): try: url = f"{self.base_url}/manga/crotpedia?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" @@ -169,21 +170,21 @@ async def crotpedia(self, link: str): async def wibusubs(self, link: str): try: url = f"{self.base_url}/drama/wibusubs?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" async def adikfilm(self, link: str): try: url = f"{self.base_url}/film/adikfilm?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" async def mydramalist_search(self, query: str): try: url = f"{self.base_url}/drama/search?query={query}" - 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" @@ -191,28 +192,28 @@ async def mydramalist_search(self, query: str): async def novelupdates_search(self, query: str): try: url = f"{self.base_url}/novel/novelupdates/search?query={query}" - 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" async def noveltoon_search(self, query: str, language: str): try: url = f"{self.base_url}/novel/noveltoon/search?query={query}&language={language}" - 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" async def noveltoon_chapter(self, link: str): try: url = f"{self.base_url}/novel/noveltoon/chapter?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" async def noveltoon_read(self, link: str): try: url = f"{self.base_url}/novel/noveltoon/read?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" @@ -220,21 +221,21 @@ async def noveltoon_read(self, link: str): async def sukidesuost_search(self, query: str, page: int): try: url = f"{self.base_url}/music/sukidesuost/search?query={query}&page={page}" - 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" async def sukidesuost(self, link: str): try: url = f"{self.base_url}/music/sukidesuost?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" async def hikarinoakari(self, link: str): try: url = f"{self.base_url}/music/hikarinoakari?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" @@ -242,14 +243,14 @@ async def hikarinoakari(self, link: str): async def google(self, query: str): try: url = f"{self.base_url}/google/search?query={query}" - 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" async def lk21(self, query: str): try: url = f"{self.base_url}/lk21/search?title={query}" - 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" @@ -257,7 +258,7 @@ async def lk21(self, query: str): async def yandex_reverse_image(self, image_url: str): try: url = f"{self.base_url}/yandex/reverse_image?image_url={image_url}" - 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" @@ -265,7 +266,7 @@ async def yandex_reverse_image(self, image_url: str): async def anilyrics_search(self, query: str): try: url = f"{self.base_url}/anime/lyrics/search?query={query}" - 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" @@ -275,70 +276,66 @@ async def anilyrics(self, link: str, type: str): """ try: url = f"{self.base_url}/anime/lyrics?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" async def lyrics(self, query: str): try: url = f"{self.base_url}/lyrics/search?query={query}" - 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" # Anipics, Porn, JAV, Booru - async def anipics(self, category: str, tags: str): - if category not in ("nsfw"): - return f"Category {category} is unknown. Available category: nsfw" - if tags not in ("ahegao", "waifu", "neko", "trap", "bj"): - return ( - f"Tags {tags} is unknown. Available tags: ahegao, waifu, neko, trap, bj" - ) + async def anipics(self, tags: str, category: str): + if tags not in ("sfw", "nsfw"): + return f"Tags {tags} is unknown. Available tags: sfw, nsfw" try: - url = f"{self.base_url}/anime/{category}/{tags}" - return await getwibu(url, timeout=15) + url = f"{self.base_url}/anipics/{tags}/{category}" + return await getwibu(url, headers=self.headers, timeout=15) except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" async def jav(self): try: url = f"{self.base_url}/porn/jav" - 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" async def porn_gif(self): try: url = f"{self.base_url}/porn/gif" - 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" async def realbooru_nsfw(self): try: url = f"{self.base_url}/booru/nsfw/rb" - 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" async def gelbooru_nsfw(self): try: url = f"{self.base_url}/booru/nsfw/gb" - 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" async def gelbooru_sfw(self): try: url = f"{self.base_url}/booru/sfw/gb" - 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" async def safebooru_sfw(self): try: url = f"{self.base_url}/booru/sfw/sb" - 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" @@ -346,42 +343,42 @@ async def safebooru_sfw(self): async def giUser(self, uid: int): try: url = f"{self.base_url}/game/gi/user?uid={uid}" - 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" async def giWeapon(self, query: str): try: url = f"{self.base_url}/game/gi/weapon?name={query}" - 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" async def giEnemy(self, query: str): try: url = f"{self.base_url}/game/gi/enemy?name={query}" - 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" async def giElement(self, query: str): try: url = f"{self.base_url}/game/gi/element?name={query}" - 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" async def giCharacter(self, query: str): try: url = f"{self.base_url}/game/gi/character?name={query}" - 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" async def giArtifact(self, query: str): try: url = f"{self.base_url}/game/gi/artifact?name={query}" - 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" @@ -392,7 +389,7 @@ async def brawlClub(self, tag: str): tag = f"%23{tag}" tag = tag.replace("#", "%23") url = f"{self.deprecated_url}/game/brawl/club?clubTag={tag}" - 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" @@ -402,14 +399,14 @@ async def brawlClubMember(self, tag: str): tag = f"%23{tag}" tag = tag.replace("#", "%23") url = f"{self.deprecated_url}/game/brawl/club?clubTag={tag}" - 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" async def brawlEvent(self): try: url = f"{self.deprecated_url}/game/brawl/event" - 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" @@ -419,7 +416,7 @@ async def brawlPlayer(self, tag: str): tag = f"%23{tag}" tag = tag.replace("#", "%23") url = f"{self.deprecated_url}/game/brawl/player?playerTag={tag}" - 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" @@ -429,7 +426,7 @@ async def brawlPlayerLog(self, tag: str): tag = f"%23{tag}" tag = tag.replace("#", "%23") url = f"{self.deprecated_url}/game/brawl/player/log?playerTag={tag}" - 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" @@ -437,7 +434,7 @@ async def brawlPlayerLog(self, tag: str): async def ud(self, query: str): try: url = f"{self.base_url}/etc/ud?query={query}" - 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" @@ -446,7 +443,7 @@ async def youtube(self, url: str): """https://www.youtube.com/watch?v=a1V0UbBNliM""" try: url = f"{self.base_url}/etc/youtube?url={url}" - 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" @@ -454,28 +451,28 @@ async def facebook(self, url: str): """https://www.facebook.com/groups/247539486825123/permalink/628642412048160""" try: url = f"{self.base_url}/etc/facebook?url={url}" - 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" async def device(self, query: str): try: url = f"{self.base_url}/etc/gsm/search?query={query}" - 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" async def device(self, query: str): try: url = f"{self.base_url}/etc/gsm/search?query={query}" - 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" async def slug(self, query: str): try: url = f"{self.base_url}/etc/gsm/slug?query={query}" - 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" @@ -483,14 +480,14 @@ async def slug(self, query: str): async def b64encode(self, query: str): try: url = f"{self.base_url}/encode/base64?query={query}" - 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" async def b64decode(self, query: str): try: url = f"{self.base_url}/decode/base64?query={query}" - 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" @@ -498,21 +495,21 @@ async def b64decode(self, query: str): async def ip_lookup(self, ip: str): try: url = f"{self.base_url}/lookup/ip?ip={ip}" - 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" async def pypi_search(self, query: str, page: int): try: url = f"{self.base_url}/pypi/search?query={query}&page={page}" - 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" async def npm_search(self, query: str): try: url = f"{self.base_url}/npm/search?query={query}" - 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" @@ -520,7 +517,7 @@ async def npm_search(self, query: str): async def terabox(self, url: str): try: url = f"{self.base_url}/bypass/terabox?url={url}" - 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" @@ -528,13 +525,13 @@ async def terabox(self, url: str): async def bard(self, query: str, cookie: str = ""): try: url = f"{self.base_url}/chatbot/bard?query={query}&cookie={cookie}" - return await getwibu(url, timeout=50) + return await getwibu(url, headers=self.headers, timeout=50) except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport" async def gpt(self, query: str, gpt_key: str = ""): try: url = f"{self.base_url}/chatbot/gpt?query={query}&gpt_key={gpt_key}" - return await getwibu(url, timeout=50) + return await getwibu(url, headers=self.headers, timeout=50) except Exception as e: return f"ERROR: {str(e)}. Report to https://t.me/YBotsSupport"