diff --git a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamUrlIdHandler.java b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamUrlIdHandler.java index 355da0402..055cd5970 100644 --- a/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamUrlIdHandler.java +++ b/app/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamUrlIdHandler.java @@ -15,7 +15,6 @@ import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URISyntaxException; import java.net.URLDecoder; -import java.util.regex.Matcher; /** * Created by Christian Schabesberger on 02.02.16. @@ -149,9 +148,9 @@ public class YoutubeStreamUrlIdHandler implements UrlIdHandler { @Override public boolean acceptUrl(String videoUrl) { - videoUrl = videoUrl.toLowerCase(); - if(videoUrl.contains("youtube") || - videoUrl.contains("youtu.be")) { + String lowercaseUrl = videoUrl.toLowerCase(); + if(lowercaseUrl.contains("youtube") || + lowercaseUrl.contains("youtu.be")) { // bad programming I know try { getId(videoUrl); diff --git a/app/src/test/java/org/schabi/newpipe/extractor/services/youtube/youtube/YoutubeStreamUrlIdHandlerTest.java b/app/src/test/java/org/schabi/newpipe/extractor/services/youtube/youtube/YoutubeStreamUrlIdHandlerTest.java index 79bb5d88e..67746ade3 100644 --- a/app/src/test/java/org/schabi/newpipe/extractor/services/youtube/youtube/YoutubeStreamUrlIdHandlerTest.java +++ b/app/src/test/java/org/schabi/newpipe/extractor/services/youtube/youtube/YoutubeStreamUrlIdHandlerTest.java @@ -111,9 +111,9 @@ public class YoutubeStreamUrlIdHandlerTest { assertTrue(urlIdHandler.acceptUrl("vnd.youtube:jZViOEv90dI")); - String sharedId = "7JIArTByb3E"; + String sharedId = "8A940MXKFmQ"; assertTrue(urlIdHandler.acceptUrl("vnd.youtube://www.youtube.com/shared?ci=" + sharedId + "&feature=twitter-deep-link")); assertTrue(urlIdHandler.acceptUrl("vnd.youtube://www.youtube.com/shared?ci=" + sharedId )); - assertTrue(urlIdHandler.acceptUrl("https://www.youtube.com/shared?ci=7JIArTByb3E")); + assertTrue(urlIdHandler.acceptUrl("https://www.youtube.com/shared?ci=" + sharedId)); } } \ No newline at end of file