added support and tests for Invidio Trending-URLs

This commit is contained in:
Connectety-L 2019-01-27 01:29:23 +01:00
parent 7493ed903b
commit cce5e4ad33
No known key found for this signature in database
GPG Key ID: 853F15C538FCE6DF
2 changed files with 5 additions and 1 deletions

View File

@ -48,6 +48,6 @@ public class YoutubeTrendingLinkHandlerFactory extends ListLinkHandlerFactory {
}
String urlPath = urlObj.getPath();
return Utils.isHTTP(urlObj) && (YoutubeParsingHelper.isYoutubeURL(urlObj)) && urlPath.equals("/feed/trending");
return Utils.isHTTP(urlObj) && (YoutubeParsingHelper.isYoutubeURL(urlObj) || YoutubeParsingHelper.isInvidioURL(urlObj)) && urlPath.equals("/feed/trending");
}
}

View File

@ -69,6 +69,10 @@ public class YoutubeTrendingLinkHandlerFactoryTest {
assertTrue(LinkHandlerFactory.acceptUrl("https://youtube.com/feed/trending"));
assertTrue(LinkHandlerFactory.acceptUrl("m.youtube.com/feed/trending"));
assertTrue(LinkHandlerFactory.acceptUrl("https://www.invidio.us/feed/trending"));
assertTrue(LinkHandlerFactory.acceptUrl("https://invidio.us/feed/trending"));
assertTrue(LinkHandlerFactory.acceptUrl("invidio.us/feed/trending"));
assertFalse(LinkHandlerFactory.acceptUrl("https://youtu.be/feed/trending"));
assertFalse(LinkHandlerFactory.acceptUrl("kdskjfiiejfia"));
assertFalse(LinkHandlerFactory.acceptUrl("https://www.youtube.com/bullshit/feed/trending"));