Revert " modified: youtube-feed-to-rss.pl"

This reverts commit 4c89c08655.

	modified:   youtube-feed-to-rss.pl
		Custom channel URLs support too complex for now.
This commit is contained in:
seasharp 2020-07-30 20:54:34 -04:00
parent 4c89c08655
commit 5a473f96b2

View File

@ -61,15 +61,15 @@ my $PlaylistFormat = "${YouTubeRSSFormat}playlist_id=";
print "Please enter the YouTube Channel URL: ","\n";
while (<>) {
my $YouTubeURL = $_ if $_ =~ m[http[s]?:\/\/.*\.youtube\.com\/(channel|user|[a-zA-Z=?]*[?&]list=PL|c|u).*$];
my $YouTubeURL = $_ if $_ =~ m[http[s]?:\/\/.*\.youtube\.com\/(channel|user|[a-zA-Z=?]*[?&]list=PL).*$];
my $OutputURL;
if ($YouTubeURL =~ m[/.*\/(c|channel)\/.*$/]) {
if ($YouTubeURL =~ /.*\/channel\/.*$/) {
print "This is a Channel\n";
$OutputURL = $YouTubeURL =~ s/\/c\//$ChannelFormat/r
} elsif ($YouTubeURL =~ m[/.*\/(u|user)\/.*$/]) {
$OutputURL = $YouTubeURL =~ s/\/channel\//$ChannelFormat/r
} elsif ($YouTubeURL =~ /.*\/user\/.*$/) {
print "This is a User\n";
$OutputURL = $YouTubeURL =~ s/\/u\//$UserFormat/r
} elsif ($YouTubeURL =~ m[/.*\/[a-zA-Z?=]*[?&]list=PL.*$/]) {
$OutputURL = $YouTubeURL =~ s/\/user\//$UserFormat/r
} elsif ($YouTubeURL =~ /.*\/[a-zA-Z?=]*[?&]list=PL.*$/) {
print "This is a Playlist\n";
$OutputURL = $YouTubeURL =~ s/\/[a-zA-Z=?]*[?&]list=/$PlaylistFormat/r
} else { print "No idea what this is.\n"; }