user2000 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am trying to get a youtube page using perl & lwp. However when i display the page after using the get function, it displays the entire page correctly except for the video part. The error is: Hello, you either have JavaScript turned off or an old version of Macromedia's Flash Player. Get the latest Flash player. I think i have to set some headers or something. Can you please guide on how to fix this problem. Thank you very much, Anant

Replies are listed 'Best First'.
Re: Perl, LWP and youtube
by moritz (Cardinal) on Aug 09, 2007 at 19:13 UTC
    What exactly are you downloading? Just the HTML page?

    Do you change any links in the downloaded page (like Javascript URLs)? Do you have internet access while viewing the page?

    Do you have javascript enabled (for file://, if you are using the noscript-extension of firefox), and do you have an up-to-date flash player?

    BTW if you want to download the videos, not just HTML, I can recommend clive. If you want to know how it's done, look at their source code - it's open source ;-)

      Hi, I want to download the url and process it further. I have javascript & up-to date flash player on my browser. The problem is that I am using lwp to get the page. And youtube probably checks and finds that i do not have flash installed. I think i have to set some headers right in lwp to get it working but I do not know how to. Please guide me to a solution. Thank you very much, Anant
Re: Perl, LWP and youtube
by Anonymous Monk on Aug 09, 2007 at 19:16 UTC
    use lwp-rget
Re: Perl, LWP and youtube
by bingos (Vicar) on Aug 10, 2007 at 08:06 UTC

    See if there is anything useful to you on CPAN

Re: Perl, LWP and youtube
by misc (Friar) on Aug 16, 2007 at 10:09 UTC
    perhaps you'd like to have a look at http://www.youtube.com/dev/

    They have a quite pretty xml interface,
    the documentation is also well written.

    Parsing the xml responses is quite easy with e.g. XML::Simple

    Update:
    I'm sorry, I had to update this node.
    Automated downloading of videos from youtube is illegal...
      Violating the "Terms of Service" and illegal are two different things