mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-28 16:00:33 +05:30
Merge pull request #365 from B0pol/update_inv_instances
Update inv instances
This commit is contained in:
commit
54d9e5a2f8
@ -105,13 +105,29 @@ public class YoutubeParsingHelper {
|
|||||||
|
|
||||||
public static boolean isInvidioURL(URL url) {
|
public static boolean isInvidioURL(URL url) {
|
||||||
String host = url.getHost();
|
String host = url.getHost();
|
||||||
return host.equalsIgnoreCase("invidio.us") || host.equalsIgnoreCase("dev.invidio.us") || host.equalsIgnoreCase("www.invidio.us") || host.equalsIgnoreCase("invidious.snopyta.org") || host.equalsIgnoreCase("de.invidious.snopyta.org") || host.equalsIgnoreCase("fi.invidious.snopyta.org") || host.equalsIgnoreCase("vid.wxzm.sx") || host.equalsIgnoreCase("invidious.kabi.tk") || host.equalsIgnoreCase("invidiou.sh") || host.equalsIgnoreCase("www.invidiou.sh") || host.equalsIgnoreCase("no.invidiou.sh") || host.equalsIgnoreCase("invidious.enkirton.net") || host.equalsIgnoreCase("tube.poal.co") || host.equalsIgnoreCase("invidious.13ad.de") || host.equalsIgnoreCase("yt.elukerio.org");
|
return host.equalsIgnoreCase("invidio.us")
|
||||||
|
|| host.equalsIgnoreCase("dev.invidio.us")
|
||||||
|
|| host.equalsIgnoreCase("www.invidio.us")
|
||||||
|
|| host.equalsIgnoreCase("invidious.snopyta.org")
|
||||||
|
|| host.equalsIgnoreCase("fi.invidious.snopyta.org")
|
||||||
|
|| host.equalsIgnoreCase("yewtu.be")
|
||||||
|
|| host.equalsIgnoreCase("invidious.ggc-project.de")
|
||||||
|
|| host.equalsIgnoreCase("yt.maisputain.ovh")
|
||||||
|
|| host.equalsIgnoreCase("invidious.13ad.de")
|
||||||
|
|| host.equalsIgnoreCase("invidious.toot.koeln")
|
||||||
|
|| host.equalsIgnoreCase("invidious.fdn.fr")
|
||||||
|
|| host.equalsIgnoreCase("watch.nettohikari.com")
|
||||||
|
|| host.equalsIgnoreCase("invidious.snwmds.net")
|
||||||
|
|| host.equalsIgnoreCase("invidious.snwmds.org")
|
||||||
|
|| host.equalsIgnoreCase("invidious.snwmds.com")
|
||||||
|
|| host.equalsIgnoreCase("invidious.sunsetravens.com")
|
||||||
|
|| host.equalsIgnoreCase("invidious.gachirangers.com");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses the duration string of the video expecting ":" or "." as seperators
|
* Parses the duration string of the video expecting ":" or "." as separators
|
||||||
* @return the duration in seconds
|
* @return the duration in seconds
|
||||||
* @throws ParsingException when more than 3 seperators are found
|
* @throws ParsingException when more than 3 separators are found
|
||||||
*/
|
*/
|
||||||
public static int parseDurationString(final String input)
|
public static int parseDurationString(final String input)
|
||||||
throws ParsingException, NumberFormatException {
|
throws ParsingException, NumberFormatException {
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package org.schabi.newpipe.extractor.services.youtube.linkHandler;
|
package org.schabi.newpipe.extractor.services.youtube.linkHandler;
|
||||||
|
|
||||||
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.BASE_YOUTUBE_INTENT_URL;
|
|
||||||
|
|
||||||
import org.schabi.newpipe.extractor.exceptions.FoundAdException;
|
import org.schabi.newpipe.extractor.exceptions.FoundAdException;
|
||||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||||
import org.schabi.newpipe.extractor.linkhandler.LinkHandler;
|
import org.schabi.newpipe.extractor.linkhandler.LinkHandler;
|
||||||
@ -9,12 +7,13 @@ import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
|
|||||||
import org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper;
|
import org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper;
|
||||||
import org.schabi.newpipe.extractor.utils.Utils;
|
import org.schabi.newpipe.extractor.utils.Utils;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.BASE_YOUTUBE_INTENT_URL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Created by Christian Schabesberger on 02.02.16.
|
* Created by Christian Schabesberger on 02.02.16.
|
||||||
@ -61,7 +60,7 @@ public class YoutubeStreamLinkHandlerFactory extends LinkHandlerFactory {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LinkHandler fromUrl(String url) throws ParsingException {
|
public LinkHandler fromUrl(String url) throws ParsingException {
|
||||||
if (url.startsWith(BASE_YOUTUBE_INTENT_URL)){
|
if (url.startsWith(BASE_YOUTUBE_INTENT_URL)) {
|
||||||
return super.fromUrl(url, BASE_YOUTUBE_INTENT_URL);
|
return super.fromUrl(url, BASE_YOUTUBE_INTENT_URL);
|
||||||
} else {
|
} else {
|
||||||
return super.fromUrl(url);
|
return super.fromUrl(url);
|
||||||
@ -191,17 +190,19 @@ public class YoutubeStreamLinkHandlerFactory extends LinkHandlerFactory {
|
|||||||
case "DEV.INVIDIO.US":
|
case "DEV.INVIDIO.US":
|
||||||
case "INVIDIO.US":
|
case "INVIDIO.US":
|
||||||
case "INVIDIOUS.SNOPYTA.ORG":
|
case "INVIDIOUS.SNOPYTA.ORG":
|
||||||
case "DE.INVIDIOUS.SNOPYTA.ORG":
|
|
||||||
case "FI.INVIDIOUS.SNOPYTA.ORG":
|
case "FI.INVIDIOUS.SNOPYTA.ORG":
|
||||||
case "VID.WXZM.SX":
|
case "YEWTU.BE":
|
||||||
case "INVIDIOUS.KABI.TK":
|
case "INVIDIOUS.GGC-PROJECT.DE":
|
||||||
case "INVIDIOU.SH":
|
case "YT.MAISPUTAIN.OVH":
|
||||||
case "WWW.INVIDIOU.SH":
|
|
||||||
case "NO.INVIDIOU.SH":
|
|
||||||
case "INVIDIOUS.ENKIRTON.NET":
|
|
||||||
case "TUBE.POAL.CO":
|
|
||||||
case "INVIDIOUS.13AD.DE":
|
case "INVIDIOUS.13AD.DE":
|
||||||
case "YT.ELUKERIO.ORG": { // code-block for hooktube.com and Invidious instances
|
case "INVIDIOUS.TOOT.KOELN":
|
||||||
|
case "INVIDIOUS.FDN.FR":
|
||||||
|
case "WATCH.NETTOHIKARI.COM":
|
||||||
|
case "INVIDIOUS.SNWMDS.NET":
|
||||||
|
case "INVIDIOUS.SNWMDS.ORG":
|
||||||
|
case "INVIDIOUS.SNWMDS.COM":
|
||||||
|
case "INVIDIOUS.SUNSETRAVENS.COM":
|
||||||
|
case "INVIDIOUS.GACHIRANGERS.COM": { // code-block for hooktube.com and Invidious instances
|
||||||
if (path.equals("watch")) {
|
if (path.equals("watch")) {
|
||||||
String viewQueryValue = Utils.getQueryValue(url, "v");
|
String viewQueryValue = Utils.getQueryValue(url, "v");
|
||||||
if (viewQueryValue != null) {
|
if (viewQueryValue != null) {
|
||||||
|
@ -25,10 +25,8 @@ public class YoutubeCommentsExtractorTest {
|
|||||||
|
|
||||||
private static final String urlYT = "https://www.youtube.com/watch?v=D00Au7k3i6o";
|
private static final String urlYT = "https://www.youtube.com/watch?v=D00Au7k3i6o";
|
||||||
private static final String urlInvidious = "https://invidio.us/watch?v=D00Au7k3i6o";
|
private static final String urlInvidious = "https://invidio.us/watch?v=D00Au7k3i6o";
|
||||||
private static final String urlInvidioush = "https://invidiou.sh/watch?v=D00Au7k3i6o";
|
|
||||||
private static YoutubeCommentsExtractor extractorYT;
|
private static YoutubeCommentsExtractor extractorYT;
|
||||||
private static YoutubeCommentsExtractor extractorInvidious;
|
private static YoutubeCommentsExtractor extractorInvidious;
|
||||||
private static YoutubeCommentsExtractor extractorInvidioush;
|
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setUp() throws Exception {
|
public static void setUp() throws Exception {
|
||||||
@ -37,15 +35,12 @@ public class YoutubeCommentsExtractorTest {
|
|||||||
.getCommentsExtractor(urlYT);
|
.getCommentsExtractor(urlYT);
|
||||||
extractorInvidious = (YoutubeCommentsExtractor) YouTube
|
extractorInvidious = (YoutubeCommentsExtractor) YouTube
|
||||||
.getCommentsExtractor(urlInvidious);
|
.getCommentsExtractor(urlInvidious);
|
||||||
extractorInvidioush = (YoutubeCommentsExtractor) YouTube
|
|
||||||
.getCommentsExtractor(urlInvidioush);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetComments() throws IOException, ExtractionException {
|
public void testGetComments() throws IOException, ExtractionException {
|
||||||
assertTrue(getCommentsHelper(extractorYT));
|
assertTrue(getCommentsHelper(extractorYT));
|
||||||
assertTrue(getCommentsHelper(extractorInvidious));
|
assertTrue(getCommentsHelper(extractorInvidious));
|
||||||
assertTrue(getCommentsHelper(extractorInvidioush));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean getCommentsHelper(YoutubeCommentsExtractor extractor) throws IOException, ExtractionException {
|
private boolean getCommentsHelper(YoutubeCommentsExtractor extractor) throws IOException, ExtractionException {
|
||||||
@ -65,7 +60,6 @@ public class YoutubeCommentsExtractorTest {
|
|||||||
public void testGetCommentsFromCommentsInfo() throws IOException, ExtractionException {
|
public void testGetCommentsFromCommentsInfo() throws IOException, ExtractionException {
|
||||||
assertTrue(getCommentsFromCommentsInfoHelper(urlYT));
|
assertTrue(getCommentsFromCommentsInfoHelper(urlYT));
|
||||||
assertTrue(getCommentsFromCommentsInfoHelper(urlInvidious));
|
assertTrue(getCommentsFromCommentsInfoHelper(urlInvidious));
|
||||||
assertTrue(getCommentsFromCommentsInfoHelper(urlInvidioush));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean getCommentsFromCommentsInfoHelper(String url) throws IOException, ExtractionException {
|
private boolean getCommentsFromCommentsInfoHelper(String url) throws IOException, ExtractionException {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user