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/bridge/__init__.py
2023-01-04 16:57:16 +01:00

26 lines
604 B
Python

from asyncio import create_task, gather
from typing import List
from pynyaata.bridge.animeultime import AnimeUltime
from pynyaata.bridge.nyaa import EraiRaws, Nyaa
from pynyaata.bridge.yggtorrent import YggAnimation, YggTorrent
from pynyaata.types import Bridge, RemoteFile
BRIDGES: List[Bridge] = [
Nyaa(),
EraiRaws(),
YggTorrent(),
YggAnimation(),
AnimeUltime(),
]
async def search_all(query: str = "", page: int = 1) -> List[RemoteFile]:
tasks = []
for bridge in BRIDGES:
tasks.append(create_task(bridge.search(query, page)))
return await gather(*tasks)