added support and tests for Invidio Trending-URLs
This commit is contained in:
parent
7493ed903b
commit
cce5e4ad33
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"));
|
||||
|
|
Loading…
Reference in New Issue