p5-www-youtube-download icon indicating copy to clipboard operation
p5-www-youtube-download copied to clipboard

download failed: 403 Forbidden

Open fluca1978 opened this issue 7 months ago • 0 comments

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?

fluca1978 avatar Jun 26 '24 07:06 fluca1978