Skip to content

Commit cce5e4a

Browse files
committed
added support and tests for Invidio Trending-URLs
1 parent 7493ed9 commit cce5e4a

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeTrendingLinkHandlerFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ public boolean onAcceptUrl(final String url) {
4848
}
4949

5050
String urlPath = urlObj.getPath();
51-
return Utils.isHTTP(urlObj) && (YoutubeParsingHelper.isYoutubeURL(urlObj)) && urlPath.equals("/feed/trending");
51+
return Utils.isHTTP(urlObj) && (YoutubeParsingHelper.isYoutubeURL(urlObj) || YoutubeParsingHelper.isInvidioURL(urlObj)) && urlPath.equals("/feed/trending");
5252
}
5353
}

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeTrendingLinkHandlerFactoryTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ public void acceptUrl() throws ParsingException {
6969
assertTrue(LinkHandlerFactory.acceptUrl("https://youtube.com/feed/trending"));
7070
assertTrue(LinkHandlerFactory.acceptUrl("m.youtube.com/feed/trending"));
7171

72+
assertTrue(LinkHandlerFactory.acceptUrl("https://www.invidio.us/feed/trending"));
73+
assertTrue(LinkHandlerFactory.acceptUrl("https://invidio.us/feed/trending"));
74+
assertTrue(LinkHandlerFactory.acceptUrl("invidio.us/feed/trending"));
75+
7276
assertFalse(LinkHandlerFactory.acceptUrl("https://youtu.be/feed/trending"));
7377
assertFalse(LinkHandlerFactory.acceptUrl("kdskjfiiejfia"));
7478
assertFalse(LinkHandlerFactory.acceptUrl("https://www.youtube.com/bullshit/feed/trending"));

0 commit comments

Comments
 (0)