forked from TeamNewPipe/NewPipeExtractor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/fuzhengyin/NewPipeExtractor …
…into dev
- Loading branch information
Showing
16 changed files
with
189 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,44 +20,55 @@ public class PeertubeChannelLinkHandlerFactoryTest { | |
|
||
@BeforeClass | ||
public static void setUp() { | ||
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host")); | ||
PeerTube.setInstance(new PeertubeInstance("https://peertube.stream", "PeerTube on peertube.stream")); | ||
linkHandler = PeertubeChannelLinkHandlerFactory.getInstance(); | ||
NewPipe.init(DownloaderTestImpl.getInstance()); | ||
} | ||
|
||
@Test | ||
public void acceptUrlTest() throws ParsingException { | ||
assertTrue(linkHandler.acceptUrl("https://peertube.mastodon.host/accounts/[email protected]")); | ||
assertTrue(linkHandler.acceptUrl("https://peertube.mastodon.host/video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa/videos")); | ||
assertTrue(linkHandler.acceptUrl("https://peertube.mastodon.host/api/v1/accounts/[email protected]/videos")); | ||
assertTrue(linkHandler.acceptUrl("https://peertube.mastodon.host/api/v1/video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa")); | ||
assertTrue(linkHandler.acceptUrl("https://peertube.stream/accounts/[email protected]")); | ||
assertTrue(linkHandler.acceptUrl("https://peertube.stream/a/[email protected]")); | ||
assertTrue(linkHandler.acceptUrl("https://peertube.stream/api/v1/accounts/[email protected]/videos")); | ||
assertTrue(linkHandler.acceptUrl("https://peertube.stream/video-channels/[email protected]/videos")); | ||
assertTrue(linkHandler.acceptUrl("https://peertube.stream/c/[email protected]/videos")); | ||
assertTrue(linkHandler.acceptUrl("https://peertube.stream/api/v1/video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa")); | ||
} | ||
|
||
@Test | ||
public void getId() throws ParsingException { | ||
assertEquals("accounts/[email protected]", | ||
linkHandler.fromUrl("https://peertube.mastodon.host/accounts/[email protected]").getId()); | ||
linkHandler.fromUrl("https://peertube.stream/accounts/[email protected]").getId()); | ||
assertEquals("accounts/[email protected]", | ||
linkHandler.fromUrl("https://peertube.mastodon.host/accounts/[email protected]/videos").getId()); | ||
assertEquals("video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa", | ||
linkHandler.fromUrl("https://peertube.mastodon.host/video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa/videos").getId()); | ||
linkHandler.fromUrl("https://peertube.stream/a/[email protected]").getId()); | ||
assertEquals("accounts/[email protected]", | ||
linkHandler.fromUrl("https://peertube.mastodon.host/api/v1/accounts/[email protected]").getId()); | ||
linkHandler.fromUrl("https://peertube.stream/accounts/[email protected]/videos").getId()); | ||
assertEquals("accounts/[email protected]", | ||
linkHandler.fromUrl("https://peertube.mastodon.host/api/v1/accounts/[email protected]/videos").getId()); | ||
assertEquals("video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa", | ||
linkHandler.fromUrl("https://peertube.mastodon.host/api/v1/video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa").getId()); | ||
linkHandler.fromUrl("https://peertube.stream/a/[email protected]/videos").getId()); | ||
assertEquals("accounts/[email protected]", | ||
linkHandler.fromUrl("https://peertube.stream/api/v1/accounts/[email protected]").getId()); | ||
assertEquals("accounts/[email protected]", | ||
linkHandler.fromUrl("https://peertube.stream/api/v1/accounts/[email protected]/videos").getId()); | ||
|
||
assertEquals("video-channels/[email protected]", | ||
linkHandler.fromUrl("https://peertube.stream/video-channels/[email protected]/videos").getId()); | ||
assertEquals("video-channels/[email protected]", | ||
linkHandler.fromUrl("https://peertube.stream/c/[email protected]/videos").getId()); | ||
assertEquals("video-channels/[email protected]", | ||
linkHandler.fromUrl("https://peertube.stream/c/[email protected]/video-playlists").getId()); | ||
assertEquals("video-channels/[email protected]", | ||
linkHandler.fromUrl("https://peertube.stream/api/v1/video-channels/[email protected]").getId()); | ||
} | ||
|
||
@Test | ||
public void getUrl() throws ParsingException { | ||
assertEquals("https://peertube.mastodon.host/video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa", | ||
linkHandler.fromId("video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa").getUrl()); | ||
assertEquals("https://peertube.mastodon.host/accounts/[email protected]", | ||
assertEquals("https://peertube.stream/video-channels/[email protected]", | ||
linkHandler.fromId("video-channels/[email protected]").getUrl()); | ||
assertEquals("https://peertube.stream/accounts/[email protected]", | ||
linkHandler.fromId("accounts/[email protected]").getUrl()); | ||
assertEquals("https://peertube.mastodon.host/accounts/[email protected]", | ||
assertEquals("https://peertube.stream/accounts/[email protected]", | ||
linkHandler.fromId("[email protected]").getUrl()); | ||
assertEquals("https://peertube.mastodon.host/video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa", | ||
linkHandler.fromUrl("https://peertube.mastodon.host/api/v1/video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa").getUrl()); | ||
assertEquals("https://peertube.stream/video-channels/[email protected]", | ||
linkHandler.fromUrl("https://peertube.stream/api/v1/video-channels/[email protected]").getUrl()); | ||
} | ||
} |
Oops, something went wrong.