fix Invidious channels being accepted by YoutubeStreamLinkHandlerFactory (#527)
fixes https://github.com/TeamNewPipe/NewPipeExtractor/issues/524, see it for more details
This commit is contained in:
parent
1414a6f178
commit
44c54d403a
|
@ -36,7 +36,7 @@ import java.util.regex.Pattern;
|
|||
|
||||
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() {
|
||||
|
|
|
@ -42,6 +42,8 @@ public class YoutubeStreamLinkHandlerFactoryTest {
|
|||
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 {
|
||||
|
|
Loading…
Reference in New Issue