Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Is it legal to use WWW::YouTube::Download ?

by bliako (Monsignor)
on Jan 07, 2020 at 12:02 UTC ( [id://11111121]=note: print w/replies, xml ) Need Help??


in reply to Is it legal to use WWW::YouTube::Download ?

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-28 18:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found