added Invidio subdomain test and fixed error in test caused by Invidio playlist support

This commit is contained in:
Connectety-L 2019-01-27 02:12:12 +01:00
parent 10939efcce
commit ec4aa9e0cd
No known key found for this signature in database
GPG Key ID: 853F15C538FCE6DF
1 changed files with 4 additions and 2 deletions

View File

@ -127,18 +127,20 @@ public class YoutubeStreamLinkHandlerFactoryTest {
@Test @Test
public void testAcceptInvidioUrl() throws ParsingException { public void testAcceptInvidioUrl() throws ParsingException {
assertTrue(linkHandler.acceptUrl("https://invidio.us/watch?v=TglNG-yjabU")); assertTrue(linkHandler.acceptUrl("https://invidio.us/watch?v=TglNG-yjabU"));
assertTrue(linkHandler.acceptUrl("http://www.invidio.us/watch?v=TglNG-yjabU"));
assertTrue(linkHandler.acceptUrl("http://invidio.us/watch?v=TglNG-yjabU")); assertTrue(linkHandler.acceptUrl("http://invidio.us/watch?v=TglNG-yjabU"));
assertTrue(linkHandler.acceptUrl("invidio.us/watch?v=3msbfr6pBNE")); assertTrue(linkHandler.acceptUrl("invidio.us/watch?v=3msbfr6pBNE"));
assertTrue(linkHandler.acceptUrl("https://invidio.us/watch?v=ocH3oSnZG3c&list=PLS2VU1j4vzuZwooPjV26XM9UEBY2CPNn2")); assertTrue(linkHandler.acceptUrl("https://invidio.us/watch?v=ocH3oSnZG3c&test=PLS2VU1j4vzuZwooPjV26XM9UEBY2CPNn2"));
assertTrue(linkHandler.acceptUrl("invidio.us/embed/3msbfr6pBNE")); assertTrue(linkHandler.acceptUrl("invidio.us/embed/3msbfr6pBNE"));
} }
@Test @Test
public void testGetInvidioIdfromUrl() throws ParsingException { public void testGetInvidioIdfromUrl() throws ParsingException {
assertEquals("TglNG-yjabU", linkHandler.fromUrl("https://invidio.us/watch?v=TglNG-yjabU").getId()); assertEquals("TglNG-yjabU", linkHandler.fromUrl("https://invidio.us/watch?v=TglNG-yjabU").getId());
assertEquals("TglNG-yjabU", linkHandler.fromUrl("http://www.invidio.us/watch?v=TglNG-yjabU").getId());
assertEquals("TglNG-yjabU", linkHandler.fromUrl("http://invidio.us/watch?v=TglNG-yjabU").getId()); assertEquals("TglNG-yjabU", linkHandler.fromUrl("http://invidio.us/watch?v=TglNG-yjabU").getId());
assertEquals("3msbfr6pBNE", linkHandler.fromUrl("invidio.us/watch?v=3msbfr6pBNE").getId()); assertEquals("3msbfr6pBNE", linkHandler.fromUrl("invidio.us/watch?v=3msbfr6pBNE").getId());
assertEquals("ocH3oSnZG3c", linkHandler.fromUrl("https://invidio.us/watch?v=ocH3oSnZG3c&list=PLS2VU1j4vzuZwooPjV26XM9UEBY2CPNn2").getId()); assertEquals("ocH3oSnZG3c", linkHandler.fromUrl("https://invidio.us/watch?v=ocH3oSnZG3c&test=PLS2VU1j4vzuZwooPjV26XM9UEBY2CPNn2").getId());
assertEquals("3msbfr6pBNE", linkHandler.fromUrl("invidio.us/embed/3msbfr6pBNE").getId()); assertEquals("3msbfr6pBNE", linkHandler.fromUrl("invidio.us/embed/3msbfr6pBNE").getId());
} }
} }