diff --git a/PlayBot/sites/youtube.pm b/PlayBot/sites/youtube.pm index b43744a3fce898200c46f181e906460c5f32253c..16ed31ef907591260e8c50623c92004abf25a20b 100644 --- a/PlayBot/sites/youtube.pm +++ b/PlayBot/sites/youtube.pm @@ -32,6 +32,9 @@ sub get { die($response->status_line) unless ($response->is_success); my $content = decode_json($response->decoded_content); + + die "video not found" if (not scalar @{ $content->{items} }); + my $video = $content->{'items'}->[0]; my %infos;