download video youtube

Stato
Discussione chiusa ad ulteriori risposte.

C1nC1n

Utente Silver
14 Novembre 2008
0
0
0
57
Cya all, vist che sto iniziando a studiarmi le Tk ho voluto provarle con questo programmino che mi e venuto in mente stamani...
Codice:
#!/usr/bin/perl
# Get Video From YouTube
# [email protected]

use HTTP::Request;
use LWP::UserAgent;
use Tk;

my $mw = new MainWindow; 

my $frm_name = $mw -> Frame() -> pack(); 
my $lab = $frm_name -> Label(-text=>"Link:") -> pack();
my $ent = $frm_name -> Entry() -> pack();

my $but = $mw -> Button(-text=>"Download", -command =>\&push_button) -> pack();

MainLoop;

sub push_button {
	my $link = $ent -> get();
        $fin="&DownloadBox=yes";
$in="http://www.vidgrab.com/download.php?url=";
$finurl=$in.$link.$fin;

my $req=HTTP::Request->new(GET=>$finurl);
my $ua=LWP::UserAgent->new();
$ua->timeout(5);
my $response=$ua->request($req);
if ($response->is_success) {
my $re=$response->content;
while($re =~ m/<a href=\"?http:\/\/y([^>\"].*)\//g){
my $k=$1;
open(FILE,">>azzzzz.html");
print FILE '<a href="http://y'.$k;
close(FILE);
system("azzzzz.html");
}
}
}
 
Stato
Discussione chiusa ad ulteriori risposte.