Compare commits

...

3 commits

3 changed files with 6 additions and 6 deletions

View file

@ -626,7 +626,7 @@ async def stream_audio(id: str):
try: try:
# Check Cache for stream URL # Check Cache for stream URL
# Check Cache for stream URL # Check Cache for stream URL
cache_key = f"v8:stream:{id}" # v8 cache key - deep debug mode cache_key = f"v9:stream:{id}" # v9 cache key - tv_embedded auth bypass
cached_data = cache.get(cache_key) cached_data = cache.get(cache_key)
stream_url = None stream_url = None
@ -644,7 +644,7 @@ async def stream_audio(id: str):
print(f"DEBUG: Fetching new stream URL for '{id}'") print(f"DEBUG: Fetching new stream URL for '{id}'")
url = f"https://www.youtube.com/watch?v={id}" url = f"https://www.youtube.com/watch?v={id}"
ydl_opts = { ydl_opts = {
# Try standard bestaudio but prefer m4a. Removed protocol constraint to see what we actually get. # Use tv_embedded client which often bypasses sign-in requirements
'format': 'bestaudio[ext=m4a]/bestaudio/best', 'format': 'bestaudio[ext=m4a]/bestaudio/best',
'quiet': True, 'quiet': True,
'noplaylist': True, 'noplaylist': True,
@ -653,7 +653,8 @@ async def stream_audio(id: str):
'socket_timeout': 30, 'socket_timeout': 30,
'retries': 3, 'retries': 3,
'force_ipv4': True, 'force_ipv4': True,
'extractor_args': {'youtube': {'player_client': ['ios', 'android', 'web']}}, # tv_embedded is an embedded player client that usually doesn't require auth
'extractor_args': {'youtube': {'player_client': ['tv_embedded', 'mediaconnect']}},
} }
try: try:

View file

@ -1,8 +1,7 @@
```python
from fastapi import FastAPI from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware from fastapi.middleware.cors import CORSMiddleware
from contextlib import asynccontextmanager from contextlib import asynccontextmanager
from backend.api import routes from backend.api.routes import router as api_router
from backend.scheduler import start_scheduler from backend.scheduler import start_scheduler
import os import os

View file

@ -3,7 +3,7 @@ uvicorn==0.34.0
spotdl spotdl
pydantic==2.10.4 pydantic==2.10.4
python-multipart==0.0.20 python-multipart==0.0.20
APScheduler==0.0.20 APScheduler>=3.10
requests==2.32.3 requests==2.32.3
yt-dlp==2024.12.23 yt-dlp==2024.12.23
ytmusicapi==1.9.1 ytmusicapi==1.9.1