From a376792a5d557e4d0e9101147af6fe49e72d4c3f Mon Sep 17 00:00:00 2001 From: Xiang Rong Lin <41164160+XiangRongLin@users.noreply.github.com> Date: Tue, 4 Feb 2020 13:49:43 +0100 Subject: [PATCH] [Youtube] Handle case where url is in "youtube.com/playlist?list=listID" format. This occurs when sharing a mix from the official youtube app. --- .../linkHandler/YoutubePlaylistLinkHandlerFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubePlaylistLinkHandlerFactory.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubePlaylistLinkHandlerFactory.java index ae66660c3..787372dcb 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubePlaylistLinkHandlerFactory.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/linkHandler/YoutubePlaylistLinkHandlerFactory.java @@ -75,9 +75,6 @@ public class YoutubePlaylistLinkHandlerFactory extends ListLinkHandlerFactory { * If it is a mix (auto-generated playlist) url, return a Linkhandler where the url is like * youtube.com/watch?v=videoId&list=playlistId *

Otherwise use super

- * @param url - * @return - * @throws ParsingException */ @Override public ListLinkHandler fromUrl(String url) throws ParsingException { @@ -86,6 +83,9 @@ public class YoutubePlaylistLinkHandlerFactory extends ListLinkHandlerFactory { String listID = Utils.getQueryValue(urlObj, "list"); if (listID != null && YoutubeParsingHelper.isYoutubeMixId(listID)) { String videoID = Utils.getQueryValue(urlObj, "v"); + if (videoID == null) { + videoID = listID.substring(2); + } String newUrl = "https://www.youtube.com/watch?v=" + videoID + "&list=" + listID; return new ListLinkHandler(new LinkHandler(url, newUrl, listID), getContentFilter(url), getSortFilter(url));