Skip to content

Commit e4b0102

Browse files
committed
Fixed the support for related videos.
1 parent 8cebc0f commit e4b0102

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

bin/youtube-viewer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4750,7 +4750,7 @@ sub print_videos {
47504750
@$videos = grep {
47514751
ref($_) eq 'HASH' && ref($_->{id}) eq 'HASH'
47524752
? (exists($_->{id}{kind})
4753-
? $_->{id}{kind} eq 'youtube#video'
4753+
? $yv_utils->is_video($_)
47544754
: 0)
47554755
: 1
47564756
} @$videos;

lib/WWW/YoutubeViewer/Utils.pm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,11 @@ sub has_entries {
258258

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

261-
($result->{pageInfo}{totalResults} // 0) > 0;
261+
if (defined($result->{pageInfo}{totalResults})) {
262+
return ($result->{pageInfo}{totalResults} > 0);
263+
}
264+
265+
return 1; # maybe
262266
}
263267

264268
=head2 normalize_filename($title, $fat32safe)

0 commit comments

Comments
 (0)