Spaces:
Running
Running
Z User commited on
Commit ·
39d80eb
1
Parent(s): 8afa4f1
v14.1: add sources= query param to /movie and /tv multi-source endpoints
Browse files2248 unmodified lines22492250225122522253225222532254225522562257225822593 unmodified lines22632264226522632264226622672268226922702271227222732248 unmodified lines# ===== Simple GET endpoints =====
@app.get("/movie/{tmdb_id}")async def movie_all(tmdb_id: int): return await run_scrape(tmdb_id, "movie")async def movie_all(tmdb_id: int, sources: str = None): keys = None if sources: keys = [k.strip() for k in sources.split(",") if k.strip() in SOURCE_MAP] or None return await run_scrape(tmdb_id, "movie", source_keys=keys)
@app.get("/movie/{tmdb_id}/{source}")async def movie_source(tmdb_id: int, source: str):3 unmodified lines return await run_scrape(tmdb_id, "movie", source_keys=[source])
@app.get("/tv/{tmdb_id}/{season}/{episode}")async def tv_all(tmdb_id: int, season: int, episode: int): return await run_scrape(tmdb_id, "tv", season=season, episode=episode)async def tv_all(tmdb_id: int, season: int, episode: int, sources: str = None): keys = None if sources: keys = [k.strip() for k in sources.split(",") if k.strip() in SOURCE_MAP] or None return await run_scrape(tmdb_id, "tv", season=season, episode=episode, source_keys=keys)
@app.get("/tv/{tmdb_id}/{season}/{episode}/{source}")async def tv_source(tmdb_id: int, season: int, episode: int, source: str):main.py+10-4