yt_dnb/downloader.pl
1	#!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 my $YT_DL_PATH = `which yt-dlp`;
7 chomp $YT_DL_PATH;
8
9 my $YT_DL_CMD = $YT_DL_PATH . " " . "-f 'ba' -x --audio-format mp3";
10 my $YT_DL_SUFFIX = "-o '%(id)s.%(ext)s'";
11
12 my $INPUT = "videos.txt";
13
14 foreach my $link ( split("\n", `/bin/cat $INPUT`) ) {
15 print("Downloading $link\n");
16 my $local_cmd = $YT_DL_CMD . " $link " . $YT_DL_SUFFIX;
17 print("$local_cmd\n");
18 `$local_cmd`;
19 }