Skip to content

Commit 54d9e5a

Browse files
authored
Merge pull request #365 from B0pol/update_inv_instances
Update inv instances
2 parents c0ceb5c + 261471e commit 54d9e5a

3 files changed

Lines changed: 33 additions & 22 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,29 @@ public static boolean isHooktubeURL(URL url) {
105105

106106
public static boolean isInvidioURL(URL url) {
107107
String host = url.getHost();
108-
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");
108+
return host.equalsIgnoreCase("invidio.us")
109+
|| host.equalsIgnoreCase("dev.invidio.us")
110+
|| host.equalsIgnoreCase("www.invidio.us")
111+
|| host.equalsIgnoreCase("invidious.snopyta.org")
112+
|| host.equalsIgnoreCase("fi.invidious.snopyta.org")
113+
|| host.equalsIgnoreCase("yewtu.be")
114+
|| host.equalsIgnoreCase("invidious.ggc-project.de")
115+
|| host.equalsIgnoreCase("yt.maisputain.ovh")
116+
|| host.equalsIgnoreCase("invidious.13ad.de")
117+
|| host.equalsIgnoreCase("invidious.toot.koeln")
118+
|| host.equalsIgnoreCase("invidious.fdn.fr")
119+
|| host.equalsIgnoreCase("watch.nettohikari.com")
120+
|| host.equalsIgnoreCase("invidious.snwmds.net")
121+
|| host.equalsIgnoreCase("invidious.snwmds.org")
122+
|| host.equalsIgnoreCase("invidious.snwmds.com")
123+
|| host.equalsIgnoreCase("invidious.sunsetravens.com")
124+
|| host.equalsIgnoreCase("invidious.gachirangers.com");
109125
}
110126

111127
/**
112-
* Parses the duration string of the video expecting ":" or "." as seperators
128+
* Parses the duration string of the video expecting ":" or "." as separators
113129
* @return the duration in seconds
114-
* @throws ParsingException when more than 3 seperators are found
130+
* @throws ParsingException when more than 3 separators are found
115131
*/
116132
public static int parseDurationString(final String input)
117133
throws ParsingException, NumberFormatException {

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
package org.schabi.newpipe.extractor.services.youtube.linkHandler;
22

3-
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.BASE_YOUTUBE_INTENT_URL;
4-
53
import org.schabi.newpipe.extractor.exceptions.FoundAdException;
64
import org.schabi.newpipe.extractor.exceptions.ParsingException;
75
import org.schabi.newpipe.extractor.linkhandler.LinkHandler;
86
import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
97
import org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper;
108
import org.schabi.newpipe.extractor.utils.Utils;
119

10+
import javax.annotation.Nullable;
1211
import java.net.MalformedURLException;
1312
import java.net.URI;
1413
import java.net.URISyntaxException;
1514
import java.net.URL;
1615

17-
import javax.annotation.Nullable;
16+
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.BASE_YOUTUBE_INTENT_URL;
1817

1918
/*
2019
* Created by Christian Schabesberger on 02.02.16.
@@ -61,7 +60,7 @@ private static String assertIsId(@Nullable String id) throws ParsingException {
6160

6261
@Override
6362
public LinkHandler fromUrl(String url) throws ParsingException {
64-
if (url.startsWith(BASE_YOUTUBE_INTENT_URL)){
63+
if (url.startsWith(BASE_YOUTUBE_INTENT_URL)) {
6564
return super.fromUrl(url, BASE_YOUTUBE_INTENT_URL);
6665
} else {
6766
return super.fromUrl(url);
@@ -191,17 +190,19 @@ public String getId(String urlString) throws ParsingException, IllegalArgumentEx
191190
case "DEV.INVIDIO.US":
192191
case "INVIDIO.US":
193192
case "INVIDIOUS.SNOPYTA.ORG":
194-
case "DE.INVIDIOUS.SNOPYTA.ORG":
195193
case "FI.INVIDIOUS.SNOPYTA.ORG":
196-
case "VID.WXZM.SX":
197-
case "INVIDIOUS.KABI.TK":
198-
case "INVIDIOU.SH":
199-
case "WWW.INVIDIOU.SH":
200-
case "NO.INVIDIOU.SH":
201-
case "INVIDIOUS.ENKIRTON.NET":
202-
case "TUBE.POAL.CO":
194+
case "YEWTU.BE":
195+
case "INVIDIOUS.GGC-PROJECT.DE":
196+
case "YT.MAISPUTAIN.OVH":
203197
case "INVIDIOUS.13AD.DE":
204-
case "YT.ELUKERIO.ORG": { // code-block for hooktube.com and Invidious instances
198+
case "INVIDIOUS.TOOT.KOELN":
199+
case "INVIDIOUS.FDN.FR":
200+
case "WATCH.NETTOHIKARI.COM":
201+
case "INVIDIOUS.SNWMDS.NET":
202+
case "INVIDIOUS.SNWMDS.ORG":
203+
case "INVIDIOUS.SNWMDS.COM":
204+
case "INVIDIOUS.SUNSETRAVENS.COM":
205+
case "INVIDIOUS.GACHIRANGERS.COM": { // code-block for hooktube.com and Invidious instances
205206
if (path.equals("watch")) {
206207
String viewQueryValue = Utils.getQueryValue(url, "v");
207208
if (viewQueryValue != null) {

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ public class YoutubeCommentsExtractorTest {
2525

2626
private static final String urlYT = "https://www.youtube.com/watch?v=D00Au7k3i6o";
2727
private static final String urlInvidious = "https://invidio.us/watch?v=D00Au7k3i6o";
28-
private static final String urlInvidioush = "https://invidiou.sh/watch?v=D00Au7k3i6o";
2928
private static YoutubeCommentsExtractor extractorYT;
3029
private static YoutubeCommentsExtractor extractorInvidious;
31-
private static YoutubeCommentsExtractor extractorInvidioush;
3230

3331
@BeforeClass
3432
public static void setUp() throws Exception {
@@ -37,15 +35,12 @@ public static void setUp() throws Exception {
3735
.getCommentsExtractor(urlYT);
3836
extractorInvidious = (YoutubeCommentsExtractor) YouTube
3937
.getCommentsExtractor(urlInvidious);
40-
extractorInvidioush = (YoutubeCommentsExtractor) YouTube
41-
.getCommentsExtractor(urlInvidioush);
4238
}
4339

4440
@Test
4541
public void testGetComments() throws IOException, ExtractionException {
4642
assertTrue(getCommentsHelper(extractorYT));
4743
assertTrue(getCommentsHelper(extractorInvidious));
48-
assertTrue(getCommentsHelper(extractorInvidioush));
4944
}
5045

5146
private boolean getCommentsHelper(YoutubeCommentsExtractor extractor) throws IOException, ExtractionException {
@@ -65,7 +60,6 @@ private boolean getCommentsHelper(YoutubeCommentsExtractor extractor) throws IOE
6560
public void testGetCommentsFromCommentsInfo() throws IOException, ExtractionException {
6661
assertTrue(getCommentsFromCommentsInfoHelper(urlYT));
6762
assertTrue(getCommentsFromCommentsInfoHelper(urlInvidious));
68-
assertTrue(getCommentsFromCommentsInfoHelper(urlInvidioush));
6963
}
7064

7165
private boolean getCommentsFromCommentsInfoHelper(String url) throws IOException, ExtractionException {

0 commit comments

Comments
 (0)