File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,10 @@ def my_hook(d):
5
5
print (f"Done downloading, now post-processing ... File saved as: { d ['filename' ]} " )
6
6
7
7
ydl_opts = {
8
- 'format' : 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best' ,
9
8
'ffmpeg_location' : r'Youtube Downloader\bin' ,
10
9
'progress_hooks' : [my_hook ],
11
10
'outtmpl' : '%(title)s.%(ext)s' ,
11
+ 'restrictfilenames' : 'True' ,
12
12
}
13
13
14
14
@@ -25,9 +25,14 @@ def downloader():
25
25
else :
26
26
URLS .append (input ('Enter Video URL: ' ))
27
27
28
+ question = input ("Do you want audio output only (Y/n): " ).lower ()
29
+ if question == 'y' :
30
+ ydl_opts ['format' ] = 'bestaudio[ext=m4a]/best,'
31
+ else :
32
+ ydl_opts ['format' ] = 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best,'
33
+
28
34
with yt_dlp .YoutubeDL (ydl_opts ) as ydl :
29
35
ydl .download (URLS )
30
-
31
-
36
+
32
37
if __name__ == "__main__" :
33
38
downloader ()
You can’t perform that action at this time.
0 commit comments