File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ max_args 2 "$@"
47
47
url=" $1 "
48
48
output_filename=" ${2:-% (title)s} .%(ext)s"
49
49
50
+ format=" bestvideo[ext=mp4][vcodec^=avc1]+bestaudio[ext=m4a]/best[ext=mp4]"
51
+
50
52
# "$srcdir/../packages/install_packages_if_absent.sh" yt-dlp ffmpeg
51
53
52
54
# in case installed manually but not in package manager
82
84
# --output "%(title)s.%(ext)s" \
83
85
#
84
86
yt-dlp \
85
- --format " bestvideo[ext=mp4][vcodec^=avc1]+bestaudio[ext=m4a]/best[ext=mp4] " \
87
+ --format " $format " \
86
88
--merge-output-format mp4 \
87
89
--continue \
88
90
--no-overwrite \
102
104
# the wrong video
103
105
# "$srcdir/vidopen.sh" "$(ls -t ./*.mp4 | head -n1)"
104
106
timestamp " Determining download filename"
105
- filename=" $( yt-dlp --get-filename --output " $output_filename " " $url " ) "
107
+ # "$format" is only needed here for it to return the right file extension
108
+ # in the "$output_filename" format eg. '.mp4' instead of '.webm'
109
+ filename=" $( yt-dlp --get-filename --format " $format " --output " $output_filename " " $url " ) "
106
110
fi
107
111
if ! [ -f " $filename " ]; then
108
112
die " Failed to find expected output file: $filename "
You can’t perform that action at this time.
0 commit comments