Compare commits
No commits in common. "72858c64f9da5318db1be6023a4583e2717bf76f" and "1b141f57ebe9f5c6f2504523f5b0dfde8e3cbb56" have entirely different histories.
72858c64f9
...
1b141f57eb
5 changed files with 8 additions and 38 deletions
|
|
@ -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"v10:stream:{id}" # v10 - web_creator client bypass
|
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,23 +644,17 @@ 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 multiple formats, prefer webm which often works better
|
# Use tv_embedded client which often bypasses sign-in requirements
|
||||||
'format': 'bestaudio[ext=webm]/bestaudio[ext=m4a]/bestaudio/best',
|
'format': 'bestaudio[ext=m4a]/bestaudio/best',
|
||||||
'quiet': False, # Enable output for debugging
|
'quiet': True,
|
||||||
'noplaylist': True,
|
'noplaylist': True,
|
||||||
'nocheckcertificate': True,
|
'nocheckcertificate': True,
|
||||||
'geo_bypass': True,
|
'geo_bypass': True,
|
||||||
'geo_bypass_country': 'US',
|
|
||||||
'socket_timeout': 30,
|
'socket_timeout': 30,
|
||||||
'retries': 5,
|
'retries': 3,
|
||||||
'force_ipv4': True,
|
'force_ipv4': True,
|
||||||
# Try web_creator client which sometimes bypasses auth, fallback to ios/android
|
# tv_embedded is an embedded player client that usually doesn't require auth
|
||||||
'extractor_args': {'youtube': {'player_client': ['web_creator', 'ios', 'android', 'web']}},
|
'extractor_args': {'youtube': {'player_client': ['tv_embedded', 'mediaconnect']}},
|
||||||
# Additional options to avoid bot detection
|
|
||||||
'http_headers': {
|
|
||||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
|
||||||
'Accept-Language': 'en-US,en;q=0.9',
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,6 @@ pydantic==2.10.4
|
||||||
python-multipart==0.0.20
|
python-multipart==0.0.20
|
||||||
APScheduler>=3.10
|
APScheduler>=3.10
|
||||||
requests==2.32.3
|
requests==2.32.3
|
||||||
yt-dlp @ https://github.com/yt-dlp/yt-dlp/archive/master.zip
|
yt-dlp==2024.12.23
|
||||||
ytmusicapi==1.9.1
|
ytmusicapi==1.9.1
|
||||||
syncedlyrics
|
syncedlyrics
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
# Services Package
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
# Cache Service - Re-export CacheManager from backend.cache_manager
|
|
||||||
from backend.cache_manager import CacheManager
|
|
||||||
|
|
||||||
__all__ = ['CacheManager']
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
# Spotify Service - Placeholder for YouTube Music API interactions
|
|
||||||
# Currently uses yt-dlp directly in routes.py
|
|
||||||
|
|
||||||
class SpotifyService:
|
|
||||||
"""
|
|
||||||
Placeholder service for Spotify/YouTube Music integration.
|
|
||||||
Currently, all music operations are handled directly in routes.py using yt-dlp.
|
|
||||||
This class exists to satisfy imports but has minimal functionality.
|
|
||||||
"""
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def search(self, query: str, limit: int = 20):
|
|
||||||
"""Search for music - placeholder"""
|
|
||||||
return []
|
|
||||||
|
|
||||||
def get_track(self, track_id: str):
|
|
||||||
"""Get track info - placeholder"""
|
|
||||||
return None
|
|
||||||
Loading…
Reference in a new issue