Merge pull request #465 from mauriciocolli/fix-travis
Fix travis and YoutubeStreamUrlIdHandler
This commit is contained in:
commit
927057ab83
2 changed files with 5 additions and 6 deletions
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue