From eb3901acee1cf913b449c7d6b925df8a0ddde9a1 Mon Sep 17 00:00:00 2001 From: bopol Date: Thu, 2 Jul 2020 21:31:05 +0200 Subject: [PATCH] update invidious instances --- .../youtube/YoutubeParsingHelper.java | 22 ++++++++++++--- .../YoutubeStreamLinkHandlerFactory.java | 27 ++++++++++--------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java index 1fd76c627..b329be282 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java @@ -105,13 +105,29 @@ public class YoutubeParsingHelper { public static boolean isInvidioURL(URL url) { 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 - * @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) throws ParsingException, NumberFormatException { diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeStreamLinkHandlerFactory.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeStreamLinkHandlerFactory.java index 7f3e6824e..596de2dac 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeStreamLinkHandlerFactory.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubeStreamLinkHandlerFactory.java @@ -1,7 +1,5 @@ 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.ParsingException; 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.utils.Utils; +import javax.annotation.Nullable; import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; 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. @@ -61,7 +60,7 @@ public class YoutubeStreamLinkHandlerFactory extends LinkHandlerFactory { @Override 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); } else { return super.fromUrl(url); @@ -191,17 +190,19 @@ public class YoutubeStreamLinkHandlerFactory extends LinkHandlerFactory { case "DEV.INVIDIO.US": case "INVIDIO.US": case "INVIDIOUS.SNOPYTA.ORG": - case "DE.INVIDIOUS.SNOPYTA.ORG": case "FI.INVIDIOUS.SNOPYTA.ORG": - case "VID.WXZM.SX": - case "INVIDIOUS.KABI.TK": - case "INVIDIOU.SH": - case "WWW.INVIDIOU.SH": - case "NO.INVIDIOU.SH": - case "INVIDIOUS.ENKIRTON.NET": - case "TUBE.POAL.CO": + case "YEWTU.BE": + case "INVIDIOUS.GGC-PROJECT.DE": + case "YT.MAISPUTAIN.OVH": 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")) { String viewQueryValue = Utils.getQueryValue(url, "v"); if (viewQueryValue != null) {