Skip to content

Commit

Permalink
fix Invidious channels being accepted by YoutubeStreamLinkHandlerFact…
Browse files Browse the repository at this point in the history
…ory (#527)

fixes #524, see it for more details
  • Loading branch information
B0pol authored Feb 5, 2021
1 parent 1414a6f commit 44c54d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 44c54d4

Please sign in to comment.