Skip to content

Commit 2ae23a6

Browse files
committed
added support for videos on invidio.us
1 parent 399b4f2 commit 2ae23a6

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

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

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,6 @@ public String getId(String urlString) throws ParsingException, IllegalArgumentEx
147147
}
148148

149149
case "HOOKTUBE.COM": {
150-
if (path.equals("watch")) {
151-
String viewQueryValue = Utils.getQueryValue(url, "v");
152-
if (viewQueryValue != null) {
153-
return assertIsID(viewQueryValue);
154-
}
155-
}
156-
if (path.startsWith("embed/")) {
157-
String id = path.substring("embed/".length());
158-
159-
return assertIsID(id);
160-
}
161150
if (path.startsWith("v/")) {
162151
String id = path.substring("v/".length());
163152

@@ -168,9 +157,24 @@ public String getId(String urlString) throws ParsingException, IllegalArgumentEx
168157

169158
return assertIsID(id);
170159
}
160+
// there is no break-statement here on purpose so the next code-block gets also run for hooktube
161+
}
162+
163+
case "INVIDIO.US": { // code-block for hooktube.com and invidio.us
164+
if (path.equals("watch")) {
165+
String viewQueryValue = Utils.getQueryValue(url, "v");
166+
if (viewQueryValue != null) {
167+
return assertIsID(viewQueryValue);
168+
}
169+
}
170+
if (path.startsWith("embed/")) {
171+
String id = path.substring("embed/".length());
172+
173+
return assertIsID(id);
174+
}
175+
176+
break;
171177
}
172-
173-
break;
174178
}
175179

176180
throw new ParsingException("Error no suitable url: " + urlString);

0 commit comments

Comments
 (0)