fix: append extensions to redirect URLs for Mopidy GStreamer compatibility
This commit is contained in:
@@ -617,10 +617,16 @@ 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)
|
||||
# Doklejamy #.aac dla kompatybilności z Mopidy (GStreamer potrzebuje wskazówki)
|
||||
if "#" not in target_url:
|
||||
target_url += "#.aac"
|
||||
return RedirectResponse(url=target_url, status_code=302)
|
||||
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)
|
||||
# Doklejamy #.mp3 dla pełnej zgodności
|
||||
if "#" not in target_url:
|
||||
target_url += "#.mp3"
|
||||
return RedirectResponse(url=target_url, status_code=302)
|
||||
else:
|
||||
raise HTTPException(status_code=404, detail="Brak streamu dla podanej stacji")
|
||||
|
||||
Reference in New Issue
Block a user