Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
- Allow channel & playlist IDs to be longer (between 11 and 64 charac…
Browse files Browse the repository at this point in the history
…ters).

This also allows IDs of "Albums & Singles".

Example:

	straw-viewer -up=UCmsgp1PvOsb1sHxeiT_403A

...now allows the selection of the 5th result, which is of type "Albums & Singles".
  • Loading branch information
trizen committed May 27, 2020
1 parent 75ca188 commit a97cc7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions bin/straw-viewer
Original file line number Diff line number Diff line change
Expand Up @@ -2951,10 +2951,14 @@ FORMAT
## ok
}
elsif (valid_num($key, $playlists) and not $contains_keywords) {

my $id = $yv_utils->get_playlist_id($playlists->[$key - 1]);

if ($args{return_playlist_id}) {
return $yv_utils->get_playlist_id($playlists->[$key - 1]);
return $id;
}
get_and_print_videos_from_playlist($yv_utils->get_playlist_id($playlists->[$key - 1]));

get_and_print_videos_from_playlist($id);
}
else {
push @for_search, $key;
Expand Down
2 changes: 1 addition & 1 deletion lib/WWW/StrawViewer/RegularExpressions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ our $digit_or_equal_re = qr/(?(?=[1-9])|=)/;
our $non_digit_or_opt_re = qr{^(?!$range_num_re)(?>[0-9]{1,3}[^0-9]|[0-9]{4}|[^0-9$opt_begin_chars])};

# Generic name
my $generic_name_re = qr/[a-zA-Z0-9_.\-]{11,34}/;
my $generic_name_re = qr/[a-zA-Z0-9_.\-]{11,64}/;
our $valid_channel_id_re = qr{^(?:.*/channel/)?(?<channel_id>(?:\w+(?:[-.]++\w++)*|$generic_name_re))(?:/.*)?\z};

our $get_channel_videos_id_re = qr{^.*/channel/(?<channel_id>(?:\w+(?:[-.]++\w++)*|$generic_name_re))};
Expand Down

0 comments on commit a97cc7f

Please sign in to comment.