diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java index 42420a1a7..258799692 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java @@ -192,6 +192,12 @@ public class YoutubeParsingHelper { } } + /** + * Checks if the given playlist id is a mix (auto-generated playlist) + * Ids from a mix start with "RD" + * @param playlistId + * @return Whether given id belongs to a mix + */ public static boolean isYoutubeMixId(String playlistId) { return playlistId.startsWith("RD"); } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMixPlaylistExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMixPlaylistExtractor.java index 64281931c..9da2e98fd 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMixPlaylistExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMixPlaylistExtractor.java @@ -18,6 +18,10 @@ import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeParsingH import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector; +/** + * A YoutubePlaylistExtractor for a mix (auto-generated playlist). + * It handles urls in the format of "youtube.com/watch?v=videoId&list=playlistId" + */ public class YoutubeMixPlaylistExtractor extends PlaylistExtractor { private Document doc; 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 3d0ba78a5..ae66660c3 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 @@ -71,6 +71,14 @@ public class YoutubePlaylistLinkHandlerFactory extends ListLinkHandlerFactory { return true; } + /** + * 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 { try {