Fails when video download is not webm
Closed this issue · 0 comments
forivall commented
I was using this on a video that downloaded as mkv rather than webm, and it failed. I only vaguely know perl, so my initial solution was
diff --git a/yt-to-webpage.pl b/yt-to-webpage.pl
index b9a918f..ab2edff 100755
--- a/yt-to-webpage.pl
+++ b/yt-to-webpage.pl
@@ -18,7 +18,7 @@ chdir($slug);
`yt-dlp --write-auto-subs --write-subs "$url"`;
my $vtt = `ls *.vtt`;
chomp($vtt);
-my $video_file = `ls *.webm`;
+my $video_file = `ls *.webm` || `ls *.mkv`;
chomp($video_file);
open(my $fh, "<", $vtt);
my $this_start = 0;
although a better solution would be to use the --print
option of yt-dlp to output the filename, like
my $video_file = `yt-dlp --write-auto-subs --write-subs "$url" --print filename`;