enzer1992 commited on
Commit
1628bb3
·
verified ·
1 Parent(s): deb60bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -11
app.py CHANGED
@@ -18,17 +18,18 @@ class MusicDownloader:
18
  def download(self, url: str, download_id: str) -> bool:
19
  downloads[download_id] = {'status': 'downloading', 'progress': '0%'}
20
 
21
- ydl_opts = {
22
- 'format': 'bestaudio/best',
23
- 'postprocessors': [{
24
- 'key': 'FFmpegExtractAudio',
25
- 'preferredcodec': 'mp3',
26
- 'preferredquality': '192',
27
- }],
28
- 'outtmpl': str(self.download_dir / '%(title)s.%(ext)s'),
29
- 'writethumbnail': True,
30
- 'progress_hooks': [lambda d: self._progress_hook(d, download_id)],
31
- }
 
32
 
33
  try:
34
  with YoutubeDL(ydl_opts) as ydl:
 
18
  def download(self, url: str, download_id: str) -> bool:
19
  downloads[download_id] = {'status': 'downloading', 'progress': '0%'}
20
 
21
+ ydl_opts = {
22
+ 'format': 'bestaudio/best',
23
+ 'postprocessors': [{
24
+ 'key': 'FFmpegExtractAudio',
25
+ 'preferredcodec': 'mp3',
26
+ 'preferredquality': '192',
27
+ }],
28
+ 'outtmpl': str(self.download_dir / '%(title)s.%(ext)s'),
29
+ 'writethumbnail': True,
30
+ 'cookiefile': 'cookies.txt', # Path to your cookies file
31
+ 'progress_hooks': [lambda d: self._progress_hook(d, download_id)],
32
+ }
33
 
34
  try:
35
  with YoutubeDL(ydl_opts) as ydl: