Add 'handle' support for new subscriptions

These are not logged in the database, but will be added to the new
version
This commit is contained in:
John Mertz 2023-03-22 18:14:55 -04:00
parent 6d2d8169a6
commit e3dc3578a4
Signed by: jpm
GPG Key ID: E9C5EA2D867501AB
2 changed files with 6 additions and 1 deletions

View File

@ -27,7 +27,7 @@ if ($ARGV[0] =~ m%^UC[a-zA-Z0-9\-\_]{22}$%) {
#print "Found raw channelId " . $params{channelId} . "\n";
} elsif ($ARGV[0] =~ m%^(?:(?:https://)?(?:www\.|m\.)?youtube\.com/)?\@([^\/]+)%) {
$params{channelHandle} = $1;
die("Handles are not yet supported. Found \@$params{channelHandle}\n");
#die("Handles are not yet supported. Found \@$params{channelHandle}\n");
} elsif ($ARGV[0] =~ m%^(https://)?(www\.|m\.)?youtube\.com/channel/UC[a-zA-Z0-9\-\_]{22}%) {
$params{channelId} = $ARGV[0];
$params{channelId} =~ s%(https://)?(www\.|m\.)?youtube\.com/channel/(UC[^/]{22})(/.*)?%$3%;

View File

@ -52,6 +52,11 @@ sub get_videos_page {
$get = $self->{location} . '/' .
'channel/' . $params{channelId} .
'/videos';
} elsif (defined $params{channelHandle}) {
$target = $params{channelHandle};
$get = $self->{location} . '/' .
'@' . $params{channelHandle} .
'/videos';
} elsif (defined $params{channelName}) {
$target = $params{channelName};
$get = $self->{location} . '/' .