diff --git a/backend/api/routes.py b/backend/api/routes.py index 764efae..d086ecb 100644 --- a/backend/api/routes.py +++ b/backend/api/routes.py @@ -609,7 +609,7 @@ async def stream_audio(id: str): try: # Check Cache for stream URL # Check Cache for stream URL - cache_key = f"v6:stream:{id}" # v6 cache key for ios client / relaxed format + cache_key = f"v7:stream:{id}" # v7 cache key - force purge for HLS fix cached_data = cache.get(cache_key) stream_url = None @@ -627,7 +627,9 @@ async def stream_audio(id: str): print(f"DEBUG: Fetching new stream URL for '{id}'") url = f"https://www.youtube.com/watch?v={id}" ydl_opts = { - 'format': 'bestaudio[ext=m4a]/bestaudio/best', # Relaxed format to prevent "Requested format not available" + # CRITICAL: protocol=https forces progressive HTTP streams, NOT HLS manifests + # HLS (.m3u8) streams cannot be played by browser