Update main.py
Browse files
main.py
CHANGED
|
@@ -9,11 +9,11 @@ def get_m4a_url(video_url: str) -> str:
|
|
| 9 |
Extracts the best m4a audio stream URL from a YouTube video using yt_dlp with cookies.
|
| 10 |
"""
|
| 11 |
ydl_opts = {
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
}
|
| 18 |
|
| 19 |
try:
|
|
|
|
| 9 |
Extracts the best m4a audio stream URL from a YouTube video using yt_dlp with cookies.
|
| 10 |
"""
|
| 11 |
ydl_opts = {
|
| 12 |
+
'format': 'bestaudio[ext=m4a]/best',
|
| 13 |
+
'quiet': True,
|
| 14 |
+
'skip_download': True,
|
| 15 |
+
'cookies_from_browser': 'chrome', # automatically extract cookies from Chrome
|
| 16 |
+
'user_agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)...',
|
| 17 |
}
|
| 18 |
|
| 19 |
try:
|