xaicron / p5-www-youtube-download

YouTube video download interface.
http://blog.livedoor.jp/xaicron/
Other
38 stars 28 forks source link

download failed: 403 Forbidden #70

Open fluca1978 opened 3 months ago

fluca1978 commented 3 months ago

I'm running the current HEAD, with the following snippet of code:

use v5.38;
use experimental 'try';
use WWW::YouTube::Download;

my $client = WWW::YouTube::Download->new;

for my $video_id ( qw/91uaaSyrKm0 Y1I1KcKvz9Q/ ) {
    say "Video id: $video_id";
    try {
    $client->download( $video_id );
    } catch( $ex ) {
    say $ex;
    }
}

Note that the second video id is the one used in the test suite.

When I run the above, I got:

% perl dl.pl
Video id: 91uaaSyrKm0
!! 91uaaSyrKm0 download failed: 403 Forbidden at dl.pl line 12.

Video id: Y1I1KcKvz9Q
!! Y1I1KcKvz9Q download failed: 403 Forbidden at dl.pl line 12.

I suspect this has something to do with YouTube itself and not the library, is there the need for some sort of authentication?