mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 23:32:59 +00:00 
			
		
		
		
	[#11930] Non-Youtube URLs should be ignored
This commit is contained in:
		| @@ -65,6 +65,7 @@ import org.schabi.newpipe.util.external_communication.ShareUtils; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Collections; | ||||
| import java.util.List; | ||||
| import java.util.Objects; | ||||
| import java.util.concurrent.atomic.AtomicBoolean; | ||||
| import java.util.stream.Collectors; | ||||
| import java.util.stream.Stream; | ||||
| @@ -461,6 +462,7 @@ public class LocalPlaylistFragment extends BaseLocalListFragment<List<PlaylistSt | ||||
|  | ||||
|         final String videoIDs = entityStream | ||||
|                 .map(entity -> getYouTubeId(entity.getUrl())) | ||||
|                 .filter(Objects::nonNull) | ||||
|                 .collect(Collectors.joining(",")); | ||||
|  | ||||
|         return "http://www.youtube.com/watch_videos?video_ids=" + videoIDs; | ||||
|   | ||||
| @@ -20,7 +20,8 @@ public class LocalPlaylistFragmentTest { | ||||
|         final Stream<StreamEntity> entityStream = asStreamEntityStream( | ||||
|  | ||||
|             "https://www.youtube.com/watch?v=1", | ||||
|             "https://www.youtube.com/watch?v=2", | ||||
|             "https://soundcloud.com/cautious-clayofficial/cold-war-2", // non-Youtube URLs should be | ||||
|             "https://www.youtube.com/watch?v=2",                       // ignored | ||||
|             "https://www.youtube.com/watch?v=3" | ||||
|         ); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Thiago F. G. Albuquerque
					Thiago F. G. Albuquerque