- New modern audio wave 'A' logo (192x192 and 512x512 icons) - PWA service worker for offline support and installability - Wake Lock API for background audio on FiiO/Android devices - Visibility change handling to prevent audio pause on screen off - Updated manifest.json with music categories and proper PWA config - Media Session API lock screen controls (already present) - Renamed app to 'Audiophile Web Player'
21 lines
578 B
Python
21 lines
578 B
Python
import yt_dlp
|
|
import json
|
|
|
|
# Test video ID from our data (e.g., Khóa Ly Biệt)
|
|
video_id = "s0OMNH-N5D8"
|
|
url = f"https://www.youtube.com/watch?v={video_id}"
|
|
|
|
ydl_opts = {
|
|
'format': 'bestaudio/best',
|
|
'quiet': True,
|
|
'noplaylist': True,
|
|
}
|
|
|
|
try:
|
|
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
|
info = ydl.extract_info(url, download=False)
|
|
print(f"Title: {info.get('title')}")
|
|
print(f"URL: {info.get('url')}") # The direct stream URL
|
|
print("Success: Extracted audio URL")
|
|
except Exception as e:
|
|
print(f"Error: {e}")
|