diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeStreamLinkHandlerFactory.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeStreamLinkHandlerFactory.java index dd2d448315..6ff6175bd6 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeStreamLinkHandlerFactory.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeStreamLinkHandlerFactory.java @@ -36,7 +36,7 @@ public class YoutubeStreamLinkHandlerFactory extends LinkHandlerFactory { - private static final Pattern YOUTUBE_VIDEO_ID_REGEX_PATTERN = Pattern.compile("([a-zA-Z0-9_-]{11})"); + private static final Pattern YOUTUBE_VIDEO_ID_REGEX_PATTERN = Pattern.compile("^([a-zA-Z0-9_-]{11})"); private static final YoutubeStreamLinkHandlerFactory instance = new YoutubeStreamLinkHandlerFactory(); private YoutubeStreamLinkHandlerFactory() { diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamLinkHandlerFactoryTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamLinkHandlerFactoryTest.java index ab61f5d344..b156e70cea 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamLinkHandlerFactoryTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamLinkHandlerFactoryTest.java @@ -42,6 +42,8 @@ public void getIdForInvalidUrls() { invalidUrls.add("https://www.youtube.com/watch?v=jZViOEv90d"); invalidUrls.add("https://www.youtube.com/watchjZViOEv90d"); invalidUrls.add("https://www.youtube.com/"); + invalidUrls.add("https://www.youtube.com/channel/UCBR8-60-B28hp2BmDPdntcQ"); + invalidUrls.add("https://invidio.us/channel/UCBR8-60-B28hp2BmDPdntcQ"); for (String invalidUrl : invalidUrls) { Throwable exception = null; try {