triflix commited on
Commit
463ee22
·
verified ·
1 Parent(s): eae14a9

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -5
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
- 'format': 'bestaudio[ext=m4a]/best', # Prefer m4a audio
13
- 'quiet': True, # Suppress console output
14
- 'skip_download': True, # Don't download, just extract info
15
- 'cookies': 'cookies.txt', # Use manually exported cookies
16
- 'user_agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36', # Mimic a browser
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: