diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/fair-viewer | 10 | ||||
-rwxr-xr-x | bin/gtk-fair-viewer | 12 |
2 files changed, 21 insertions, 1 deletions
diff --git a/bin/fair-viewer b/bin/fair-viewer index e20192b..83d35e2 100755 --- a/bin/fair-viewer +++ b/bin/fair-viewer @@ -2829,6 +2829,16 @@ sub print_playlists { my $url = $results->{url}; my $playlists = $results->{results} // []; + if (ref($playlists) eq 'HASH') { + if (exists $playlists->{playlists}) { + $playlists = $playlists->{playlists}; + } + else { + warn "\n[!] No playlists...\n"; + $playlists = []; + } + } + state $info_format = <<"FORMAT"; TITLE: %s diff --git a/bin/gtk-fair-viewer b/bin/gtk-fair-viewer index 1935018..bc9c747 100755 --- a/bin/gtk-fair-viewer +++ b/bin/gtk-fair-viewer @@ -2535,7 +2535,17 @@ sub display_results { #pp $items; if (ref($items) eq 'HASH') { - $items = $items->{videos}; + + if (exists $items->{videos}) { + $items = $items->{videos}; + } + elsif (exists $items->{playlists}) { + $items = $items->{playlists}; + } + else { + warn "[!] No results...\n"; + $items = []; + } } hide_feeds_window(); |