The server has some rules-of-thumb to identify whether a client is a robot. The most common is the agent string: the client's version, make, OS etc. Just point your browser to any public service which tells you what your ip and agent string are to see what I mean.

Looking at the source of WWW::YouTube::Download I can see this:

sub new { my $class = shift; my %args = @_; $args{ua} = LWP::UserAgent->new( agent => __PACKAGE__.'/'.$VERSION, parse_head => 0, ) unless exists $args{ua}; bless \%args, $class; }

Which basically creates a LWP::UserAgent object with default id (agent): the package and version, e.g. WWW::YouTube::Download/0.62 - something which YT has blacklisted ages ago. There is a workaround because the constructor allows caller to supply his own UserAgent object. (introducing flexibilities like these is why TIMTOWTDI is synonymous to Perl)

This will get you the videos so that you can continue your education:

my $ua = new LWP::UserAgent; $ua->agent('wolf-dressed-as-lamb/666'); my $dl = WWW::YouTube::Download->new('ua' => $ua);

Of course you need to resolve the 2 substantial points raised already: 1) Re: Is it legal to use WWW::YouTube::Download ? and 2) Re: Is it legal to use WWW::YouTube::Download ?

bw, bliako


In reply to Re: Is it legal to use WWW::YouTube::Download ? by bliako
in thread Is it legal to use WWW::YouTube::Download ? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.