Files
Mohamed Zumair 48b3f5e85f Migrate streaming providers functions to async & improve performance (#331)
* Migrate streaming providers functions to async & improve performance

* Fix streaming provider file selection & validate file extension as video type

* Improve RD torrent handling

* Find file based on filename or the largest file or episode based and remove index base file finding due to not trustable

* Add support for updating torrent matadata with offcloud

* Fix RD background task to update torrent metadata

* Fix OC file size callback function

* Fix AD, DL & PM

* Fix PikPak httpx client leak & use medialink for speed & set 5 min for token cache

* Migrate to AIOSeedrcc & fix season pack file selecting & refactorings

* Qbittorrent: Add support for season pack file finding & disable dht, pex, lsd on private indexer torrent

* Migrate to aiohttp for stability on resource fetching & bugfixes

* Migrated to aioseedrcc & update libs

* pass indexer type & remove Upper info hash finding
2024-11-01 15:58:39 +05:30

26 lines
709 B
Python

from fastapi import APIRouter
from fastapi.responses import JSONResponse
from db.schemas import AuthorizeData
from streaming_providers.debridlink.client import DebridLink
from utils import const
router = APIRouter()
@router.get("/get-device-code")
async def get_device_code():
async with DebridLink() as dl_client:
return JSONResponse(
content=await dl_client.get_device_code(), headers=const.NO_CACHE_HEADERS
)
@router.post("/authorize")
async def authorize(data: AuthorizeData):
async with DebridLink() as dl_client:
return JSONResponse(
content=await dl_client.authorize(data.device_code),
headers=const.NO_CACHE_HEADERS,
)