#!/usr/bin/perl use strict; use warnings; # Try and find .mp3 links in archive.org pages if ( ! defined $ARGV[0] ) { print "Need to pass archive.org URL\n"; exit 1; } my $page_url = shift(@ARGV); my $page_content = `curl -s $page_url`; my @names; my @links; my $counter = 1; foreach my $line ( split("\n",$page_content) ) { chomp $line; if ( $line =~ m/>", \$filename); foreach my $char ( split("",$name) ) { if ( $char =~ m/[\s->']/ ) { print $fh ""; } else { print $fh "$char"; } } return $filename; } foreach my $key ( keys %link_map ) { #print "$key : $link_map{$key}\n"; my $filename = make_filename($key) . ".mp3"; #print "wget -q $link_map{$key} -O $filename\n"; print "Downloading $key\n"; system("wget -q $link_map{$key} -O $filename"); }