Download MP3 file from site with cookies?

Discussion in 'Perl Misc' started by dave_nul@hotmail.com, Jul 4, 2007.

  1. Guest

    Hello, everyone. I'm writing a Perl script that downloads and saves
    to disk all of the MP3 files linked on a given Web page. For Web
    sites that do not require the use of cookies, I'm able to use
    LWP::Simple::getstore() without any problem. And I already know how
    to download HTML Web pages from sites that use cookies, using
    LWP::UserAgent->new(), HTTP::Cookies::Netscape->new(), HTTP::Request-
    >new(), etc.


    But I do not see how to do both at the same time -- in other words,
    download and store an MP3 file from a site that requires one to be
    logged in with a cookie. I tried using the HTTP::Request->new(), $ua-
    >request(), but it does not work because the content type is not 'text/

    html', but instead 'audio/mpeg', and thus $response->is_success is
    false.

    Any ideas?
    , Jul 4, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Dyer
    Replies:
    6
    Views:
    19,880
    Knute Johnson
    Jan 22, 2006
  2. Asle Frantzen

    Mp3-player - how to play an mp3?

    Asle Frantzen, Jul 8, 2003, in forum: C++
    Replies:
    5
    Views:
    663
    Kelsey Bjarnason
    Jul 22, 2003
  3. Sunfire
    Replies:
    7
    Views:
    439
    Sunfire
    Nov 10, 2007
  4. _Who
    Replies:
    7
    Views:
    2,653
  5. HY Tech
    Replies:
    0
    Views:
    615
    HY Tech
    Sep 7, 2003
Loading...

Share This Page