Skip to content

Instantly share code, notes, and snippets.

@TopherGopher
Created January 4, 2014 01:59
Show Gist options
  • Save TopherGopher/8250496 to your computer and use it in GitHub Desktop.
Save TopherGopher/8250496 to your computer and use it in GitHub Desktop.
This script goes into the rss files specified and downloads the end file specified. I used this to help me grab the keynotes from the DEFCON conferences because the videos took forever to buffer online. Grab the RSS files for the podcasts in order to get the video URLs.
#!/usr/bin/perl -w
use strict;
use LWP::Simple;
use XML::RSS;
my @files = qw(defcon-10-video.rss
defcon-11-video.rss
defcon-12-video.rss
defcon-13-video.rss
defcon-14-video.rss
defcon-15-video.rss
defcon-16-video.rss
defcon-17-video.rss
defcon-18-video.rss);
my $base = '/home/user/www.defcon.org/podcast';
foreach my $url ( @files )
{
$url = $base."/".$url;
my $rss = XML::RSS->new();
$rss->parsefile( $url );
my $channel = $rss->{channel};
my $image = $rss->{image};
foreach my $item ( @{ $rss->{items} } )
{
#print qq|<b><</b><a href="$$item{link}">$$item{title}</a><br><br>\n$$item{enclosure}|;
#print qq|$item->{enclosure}->{url}|;
my $url_name = $item->{enclosure}->{url};
$url_name = "wget -c ".$url_name;
system($url_name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment