feat: implement caching and redirect endpoints for premium live streams
This commit is contained in:
@@ -611,3 +611,16 @@ def podcast_rss(station: str, slug_with_ext: str, request: Request, db: Session
|
||||
if not xml:
|
||||
return Response(status_code=404)
|
||||
return Response(content=xml, media_type="application/xml")
|
||||
|
||||
@app.get("/live/{station}")
|
||||
def live_stream_redirect(station: str, db: Session = Depends(db_session)):
|
||||
if station == "radio357":
|
||||
config_url = db.query(Config).filter_by(key="r357_live_url").first()
|
||||
target_url = config_url.value if config_url else "https://stream.rcs.revma.com/ye5kghkgcm0uv"
|
||||
return RedirectResponse(url=target_url)
|
||||
elif station == "rns":
|
||||
config_url = db.query(Config).filter_by(key="rns_live_url").first()
|
||||
target_url = config_url.value if config_url else "https://stream.rcs.revma.com/4md4m0a0fs8uv"
|
||||
return RedirectResponse(url=target_url)
|
||||
else:
|
||||
raise HTTPException(status_code=404, detail="Brak streamu dla podanej stacji")
|
||||
|
||||
Reference in New Issue
Block a user