Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Real Synthetic Audio downloader

by Mr. Muskrat (Canon)
on Oct 24, 2002 at 16:22 UTC ( [id://207766]=note: print w/replies, xml ) Need Help??


in reply to Real Synthetic Audio downloader

diotalevi++ for introducing me to some wonderful sounding music.

When you run this, it displays nothing unless you change the value of the DEBUG constant to a true value. Even after changing the DEBUG value, it looks like the program is stuck in an endless loop. In the download_files subroutine where you have the file exist check of $file, I have added an else clause to print that it's downloading like this:

if (-e $file) { print "SKIP\n" if DEBUG; next; } else { print "downloading...\n" if DEBUG; }

Also, I found two problems with your code.

1) You define the $SaveExt variable with this code:
our $SaveExt = '.wma';
Then in the download_files subroutine, you use the value like this:
my $file = "$directory$base_file.$SaveExt";
To keep the filename from looking like 081902..wma, change this line to:
my $file = "$directory$base_file$SaveExt";

2) I looked at the javascript files that this script parses and I found a problem with your regex. You have a $ at the end that should not be there. Change:
our $SaveType = qr/http:\/\/.+?\.asx$/;
to:
our $SaveType = qr/http:\/\/.+?\.asx/;
and it appears to work as expected.

Update: You fixed your source as I was typing this up. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://207766]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-24 12:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found