aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortrizen <trizen@protonmail.com>2020-05-27 18:30:35 +0300
committerJesús <heckyel@hyperbola.info>2020-06-06 21:36:58 -0500
commitc8e10c6d9f14f52718d623416db7b1e21a5314f2 (patch)
treecc2ffe2cae8c4cdde1ee433957309c84c9c4f848
parentada3e52cced058a2aaf50f5df4d4b4d02954c8c8 (diff)
downloadfair-viewer-c8e10c6d9f14f52718d623416db7b1e21a5314f2.tar.lz
fair-viewer-c8e10c6d9f14f52718d623416db7b1e21a5314f2.tar.xz
fair-viewer-c8e10c6d9f14f52718d623416db7b1e21a5314f2.zip
- Allow channel & playlist IDs to be longer (between 11 and 64 characters).
This also allows IDs of "Albums & Singles". Example: fair-viewer -up=UCmsgp1PvOsb1sHxeiT_403A ...now allows the selection of the 5th result, which is of type "Albums & Singles". Signed-off-by: Jesús <heckyel@hyperbola.info>
-rwxr-xr-xbin/fair-viewer8
-rw-r--r--lib/WWW/FairViewer/RegularExpressions.pm2
2 files changed, 7 insertions, 3 deletions
diff --git a/bin/fair-viewer b/bin/fair-viewer
index 526297d..b06dcda 100755
--- a/bin/fair-viewer
+++ b/bin/fair-viewer
@@ -2954,10 +2954,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;
diff --git a/lib/WWW/FairViewer/RegularExpressions.pm b/lib/WWW/FairViewer/RegularExpressions.pm
index 6c298f2..6b8ed5f 100644
--- a/lib/WWW/FairViewer/RegularExpressions.pm
+++ b/lib/WWW/FairViewer/RegularExpressions.pm
@@ -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))};