modified: youtube-feed-to-rss.pl
Added compatability for new url formats
This commit is contained in:
		
							parent
							
								
									015ecdc293
								
							
						
					
					
						commit
						4c89c08655
					
				@ -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).*$];
 | 
			
		||||
	my $YouTubeURL = $_ if $_ =~ m[http[s]?:\/\/.*\.youtube\.com\/(channel|user|[a-zA-Z=?]*[?&]list=PL|c|u).*$];
 | 
			
		||||
	my $OutputURL;
 | 
			
		||||
	if ($YouTubeURL =~ /.*\/channel\/.*$/) {
 | 
			
		||||
	if ($YouTubeURL =~ m[/.*\/(c|channel)\/.*$/]) {
 | 
			
		||||
		print "This is a Channel\n";
 | 
			
		||||
		$OutputURL = $YouTubeURL =~ s/\/channel\//$ChannelFormat/r
 | 
			
		||||
	} elsif ($YouTubeURL =~ /.*\/user\/.*$/) {
 | 
			
		||||
		$OutputURL = $YouTubeURL =~ s/\/c\//$ChannelFormat/r
 | 
			
		||||
	} elsif ($YouTubeURL =~ m[/.*\/(u|user)\/.*$/]) {
 | 
			
		||||
		print "This is a User\n";
 | 
			
		||||
		$OutputURL = $YouTubeURL =~ s/\/user\//$UserFormat/r
 | 
			
		||||
	} elsif ($YouTubeURL =~ /.*\/[a-zA-Z?=]*[?&]list=PL.*$/) {
 | 
			
		||||
		$OutputURL = $YouTubeURL =~ s/\/u\//$UserFormat/r
 | 
			
		||||
	} elsif ($YouTubeURL =~ m[/.*\/[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"; }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user