added support for channels on invidio.us

This commit is contained in:
Connectety-L 2019-01-24 10:48:29 +01:00
parent 79ba6aba95
commit ae23059d66
No known key found for this signature in database
GPG key ID: 853F15C538FCE6DF
2 changed files with 3 additions and 2 deletions

View file

@ -46,7 +46,7 @@ public class YoutubeChannelLinkHandlerFactory extends ListLinkHandlerFactory {
URL urlObj = Utils.stringToURL(url); URL urlObj = Utils.stringToURL(url);
String path = urlObj.getPath(); String path = urlObj.getPath();
if (!(YoutubeParsingHelper.isYoutubeURL(urlObj) || urlObj.getHost().equalsIgnoreCase("hooktube.com"))) { if (!YoutubeParsingHelper.isYoutubeALikeURL(urlObj)) { // fixme: accepts youtu.be and youtube-nocookie.com
throw new ParsingException("the URL given is not a Youtube-URL"); throw new ParsingException("the URL given is not a Youtube-URL");
} }

View file

@ -63,7 +63,8 @@ public class YoutubeParsingHelper {
String host = url.getHost(); String host = url.getHost();
return host.equalsIgnoreCase("youtube.com") || host.equalsIgnoreCase("www.youtube.com") return host.equalsIgnoreCase("youtube.com") || host.equalsIgnoreCase("www.youtube.com")
|| host.equalsIgnoreCase("m.youtube.com") || host.equalsIgnoreCase("www.youtube-nocookie.com") || host.equalsIgnoreCase("m.youtube.com") || host.equalsIgnoreCase("www.youtube-nocookie.com")
|| host.equalsIgnoreCase("youtu.be") || host.equalsIgnoreCase("hooktube.com"); || host.equalsIgnoreCase("youtu.be") || host.equalsIgnoreCase("hooktube.com")
|| host.equalsIgnoreCase("invidio.us");
} }
public static long parseDurationString(String input) public static long parseDurationString(String input)