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 lines224922502251225222532254225522563 unmodified lines226022612262226322642265226622672248 unmodified lines# ===== Simple GET endpoints =====@app.get("/movie/{tmdb_id}")async def movie_all(tmdb_id: int):return await run_scrape(tmdb_id, "movie")@app.get("/movie/{tmdb_id}/{source}")async def movie_source(tmdb_id: int, source: str):3 unmodified linesreturn 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)@app.get("/tv/{tmdb_id}/{season}/{episode}/{source}")async def tv_source(tmdb_id: int, season: int, episode: int, source: str):2248 unmodified lines224922502251225222532254225522562257225822593 unmodified lines226322642265226622672268226922702271227222732248 unmodified lines# ===== Simple GET endpoints =====@app.get("/movie/{tmdb_id}")async def movie_all(tmdb_id: int, sources: str = None):keys = Noneif sources:keys = [k.strip() for k in sources.split(",") if k.strip() in SOURCE_MAP] or Nonereturn 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 linesreturn 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, sources: str = None):keys = Noneif sources:keys = [k.strip() for k in sources.split(",") if k.strip() in SOURCE_MAP] or Nonereturn 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