diff --git a/youtube-feed-to-rss.pl b/youtube-feed-to-rss.pl index 826cffa..cbd78fd 100755 --- a/youtube-feed-to-rss.pl +++ b/youtube-feed-to-rss.pl @@ -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"; }