This repository has been archived on 2023-10-01. You can view files and clone it, but cannot push or open issues or pull requests.
PyNyaaTa/pynyaata/connectors/__init__.py

22 lines
486 B
Python
Raw Normal View History

2021-01-03 19:41:58 +00:00
from asyncio import gather
2020-04-24 19:01:44 +00:00
from .animeultime import AnimeUltime
from .core import Other
from .nyaa import Nyaa
2021-01-03 19:41:58 +00:00
async def run_all(*args, **kwargs):
2021-01-07 20:19:50 +00:00
coroutines = [Nyaa(*args, **kwargs).run(),
2023-10-01 08:23:35 +00:00
AnimeUltime(*args, **kwargs).run()]
2021-01-07 20:19:50 +00:00
return list(await gather(*coroutines))
2020-04-24 19:01:44 +00:00
2021-01-30 18:40:36 +00:00
def get_instance(url, query=''):
2020-04-24 19:01:44 +00:00
if 'nyaa.si' in url:
return Nyaa(query)
elif 'anime-ultime' in url:
return AnimeUltime(query)
else:
return Other(query)