From d9e2da53c3b781c77f7726da6131f3e01c28e161 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Fri, 25 Dec 2020 15:00:31 +0100 Subject: [PATCH] =?UTF-8?q?Replace=20explicit=20string=20checks=20whether?= =?UTF-8?q?=20a=20playlist=20=C3=ADd=20is=20a=20certain=20YouTube=20Mix=20?= =?UTF-8?q?type=20with=20calling=20the=20dedicated=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/youtube/YoutubeParsingHelper.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 48589cc33..40d15288a 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 @@ -226,20 +226,20 @@ public class YoutubeParsingHelper { * @throws ParsingException If the playlistId is a Channel Mix or not a mix. */ public static String extractVideoIdFromMixId(final String playlistId) throws ParsingException { - if (playlistId.startsWith("RDMM")) { //My Mix + if (playlistId.startsWith("RDMM")) { // My Mix return playlistId.substring(4); - } else if (playlistId.startsWith("RDAMVM") || playlistId.startsWith("RDCLAK")) { //Music mix + } else if (isYoutubeMusicMixId(playlistId)) { // starts with "RDAMVM" or "RDCLAK" return playlistId.substring(6); - } else if (playlistId.startsWith("RMCM")) { //Channel mix - //Channel mix are build with RMCM{channelId}, so videoId can't be determined + } else if (isYoutubeChannelMixId(playlistId)) { // starts with "RMCM" + // Channel mix are build with RMCM{channelId}, so videoId can't be determined throw new ParsingException("Video id could not be determined from mix id: " + playlistId); - } else if (playlistId.startsWith("RD")) { // Normal mix + } else if (isYoutubeMixId(playlistId)) { // normal mix, starts with "RD" return playlistId.substring(2); - } else { //not a mix + } else { // not a mix throw new ParsingException("Video id could not be determined from mix id: " + playlistId); } }