Inicio > unix/linux, web > YouTube++ Download and Converter

YouTube++ Download and Converter

lunes, 15 de septiembre de 2008 Albertux Dejar un comentario Ir a comentarios

YouTube++ Download and Converter

Necesitas: Perl, wget, ffmpeg y este script:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl
use LWP::Simple;
print "YouTube++ (URL's to MP3's) By Albertux\n[http://albertux.ayalasoft.net]\n";
 
$total = @ARGV;
 
if ($total==0) {
 
	print "\nExample: ~\$ youtube\+\+ url1 url2 url3 ...\n";
 
} else {
 
	foreach(@ARGV) {
 
		$URL = $_;
		$aux = index($URL,"?v=");
		$a = substr $URL,$aux+3,11;
		$content = get($URL);
		@lines = split("\n",$content);
 
		foreach(@lines) {
			my $aux = index($_,"&t=");
			if ($aux > -1) {
				$t = substr $_, $aux+3,32;
			}
		}
		system "wget -c -O \"$a.flv\" \"http://youtube.com/get_video?video_id=$a&t=$t\"";
		system "ffmpeg -i \"$a.flv\" -ab 128k \"$a.mp3\"";
	}
}
print "\nFeedback to: <albertoi7\@gmail.com>\n";

Ejemplo tu tienes un archivo con las urls de algunos videos (YouTubeUrls.txt):

http://www.youtube.com/watch?v=-j39ABZyzek
http://www.youtube.com/watch?v=5cGvzApDZKI
http://www.youtube.com/watch?v=w1mgEQTMVB8
...

Este script bajara todos los archivos flv y los convertira a mp3.

youtube++ `cat YouTubeUrls.txt`
Categories: unix/linux, web Tags: ,
  1. Sin comentarios aún.
  1. Sin trackbacks aún.