Browse Source

Little stub script for downloading yt videos as mp3s based on a list of urls

Simon Watson 3 years ago
parent
commit
a5dc50c59e
2 changed files with 37 additions and 0 deletions
  1. 19 0
      yt_dnb/downloader.pl
  2. 18 0
      yt_dnb/videos.txt

+ 19 - 0
yt_dnb/downloader.pl

@@ -0,0 +1,19 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my $YT_DL_PATH = `which yt-dlp`;
+chomp $YT_DL_PATH;
+
+my $YT_DL_CMD = $YT_DL_PATH . " " . "-f 'ba' -x --audio-format mp3";
+my $YT_DL_SUFFIX = "-o '%(id)s.%(ext)s'";
+
+my $INPUT = "videos.txt";
+
+foreach my $link ( split("\n", `/bin/cat $INPUT`) ) {
+	print("Downloading $link\n");
+	my $local_cmd = $YT_DL_CMD . " $link " . $YT_DL_SUFFIX;
+	print("$local_cmd\n");
+	`$local_cmd`;
+}

+ 18 - 0
yt_dnb/videos.txt

@@ -0,0 +1,18 @@
+https://www.youtube.com/watch?v=LYgNN8lDQ5s
+https://www.youtube.com/watch?v=kBC5MYpvNHk
+https://www.youtube.com/watch?v=7FU67aB5q7g
+https://www.youtube.com/watch?v=KioVhomQM74
+https://www.youtube.com/watch?v=fWtnl6WaPoA
+https://www.youtube.com/watch?v=pC6oZdamZFk
+https://www.youtube.com/watch?v=aaIxnJTlcNI
+https://www.youtube.com/watch?v=AEOeFZqHuqs
+https://www.youtube.com/watch?v=UMpDiFrjmeY
+https://www.youtube.com/watch?v=bS2yN1Dm8xA
+https://www.youtube.com/watch?v=Txj7m0q8uGY
+https://www.youtube.com/watch?v=qXm4wmJH1AE
+https://www.youtube.com/watch?v=Kg4J7BZ-JuQ
+https://www.youtube.com/watch?v=I_xHJB4l_YY
+https://www.youtube.com/watch?v=Y-y6X220TGw
+https://www.youtube.com/watch?v=_dTRYnziciU
+https://www.youtube.com/watch?v=Sjek6NPqoRE
+