From a9ce0b29d06c55344734c1e17b008353a455cfec Mon Sep 17 00:00:00 2001 From: oscar Date: Wed, 25 Jul 2018 17:15:56 +0200 Subject: [PATCH] Fixed improper handling of playlist deep links --- .../linkHandler/YoutubeStreamLinkHandlerFactory.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 b159e3ad..0fae5ea8 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 @@ -63,7 +63,9 @@ public class YoutubeStreamLinkHandlerFactory extends LinkHandlerFactory { String id; String lowercaseUrl = url.toLowerCase(); if (lowercaseUrl.contains("youtube")) { - if (url.contains("attribution_link")) { + if (lowercaseUrl.contains("list=")) { + throw new ParsingException("Error no suitable url: " + url); + } else if (url.contains("attribution_link")) { try { String escapedQuery = Parser.matchGroup1("u=(.[^&|$]*)", url); String query = URLDecoder.decode(escapedQuery, "UTF-8"); @@ -83,7 +85,9 @@ public class YoutubeStreamLinkHandlerFactory extends LinkHandlerFactory { id = Parser.matchGroup1("[?&]v=" + ID_PATTERN, url); } } else if (lowercaseUrl.contains("youtu.be")) { - if (url.contains("v=")) { + if (lowercaseUrl.contains("list=")) { + throw new ParsingException("Error no suitable url: " + url); + } else if (url.contains("v=")) { id = Parser.matchGroup1("v=" + ID_PATTERN, url); } else { id = Parser.matchGroup1("[Yy][Oo][Uu][Tt][Uu]\\.[Bb][Ee]/" + ID_PATTERN, url);