Skip to content

Commit

Permalink
Fixed the support for related videos.
Browse files Browse the repository at this point in the history
  • Loading branch information
trizen committed Feb 22, 2023
1 parent 8cebc0f commit e4b0102
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/youtube-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -4750,7 +4750,7 @@ sub print_videos {
@$videos = grep {
ref($_) eq 'HASH' && ref($_->{id}) eq 'HASH'
? (exists($_->{id}{kind})
? $_->{id}{kind} eq 'youtube#video'
? $yv_utils->is_video($_)
: 0)
: 1
} @$videos;
Expand Down
6 changes: 5 additions & 1 deletion lib/WWW/YoutubeViewer/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,11 @@ sub has_entries {

ref($result) eq 'HASH' or return;

($result->{pageInfo}{totalResults} // 0) > 0;
if (defined($result->{pageInfo}{totalResults})) {
return ($result->{pageInfo}{totalResults} > 0);
}

return 1; # maybe
}

=head2 normalize_filename($title, $fat32safe)
Expand Down

0 comments on commit e4b0102

Please sign in to comment.