Skip to content

Commit

Permalink
- Also support listing playlists from channel under -fc.
Browse files Browse the repository at this point in the history
  • Loading branch information
trizen committed Oct 11, 2020
1 parent 5b82298 commit ac35014
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions bin/youtube-viewer
Expand Up @@ -2888,11 +2888,12 @@ sub print_channels_from_file {
print <<"EOT";
# Search for a channel
<keyword> : search for a channel
<keyword> : search for a channel
# Select a channel
<number> : latest uploads from channel
:pv=i :popular=i : popular uploads from channel
<number> : latest uploads from channel
:pv=i :popular=i : popular uploads from channel
:up=i :playlists=i : playlists from channel
# Remove channels
:rm=i :remove=i,i : remove the selected channels from file
Expand All @@ -2919,6 +2920,26 @@ EOT
warn_no_thing_selected('channel');
}
}
elsif ($opt =~ /^(?:p|playlists?|up)${digit_or_equal_re}(.*)/) {
if (my @nums = get_valid_numbers($#channels, $1)) {

foreach my $id (@nums) {

my $channel_id = $channels[$id]{id};
my $request = $yv_obj->playlists($channel_id);

if ($yv_utils->has_entries($request)) {
print_playlists($request);
}
else {
warn_no_results('playlist');
}
}
}
else {
warn_no_thing_selected('channel');
}
}
elsif ($opt =~ /^(?:r|rm|remove)${digit_or_equal_re}(.*)/) {
if (my @nums = get_valid_numbers($#channels, $1)) {

Expand Down

0 comments on commit ac35014

Please sign in to comment.