Skip to content

Commit 6390eb2

Browse files
committed
fixed YoutubePlaylistLinkHandlerFactory accepting invalid links
1 parent 1ab7a1f commit 6390eb2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ public String getId(String url) throws ParsingException {
3030
throw new ParsingException("the url given is not a Youtube-URL");
3131
}
3232

33+
String path = urlObj.getPath();
34+
if (!path.equals("/watch" ) && !path.equals("/playlist")) {
35+
throw new ParsingException("the url given is neither a video nor a playlist URL");
36+
}
37+
3338
String listID = Utils.getQueryValue(urlObj, "list");
3439

3540
if (listID == null) {

0 commit comments

Comments
 (0)