Skip to content

Commit d9e2da5

Browse files
committed
Replace explicit string checks whether a playlist íd is a certain YouTube Mix type with calling the dedicated methods
1 parent 3033c0b commit d9e2da5

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,20 +226,20 @@ public static boolean isYoutubeChannelMixId(final String playlistId) {
226226
* @throws ParsingException If the playlistId is a Channel Mix or not a mix.
227227
*/
228228
public static String extractVideoIdFromMixId(final String playlistId) throws ParsingException {
229-
if (playlistId.startsWith("RDMM")) { //My Mix
229+
if (playlistId.startsWith("RDMM")) { // My Mix
230230
return playlistId.substring(4);
231231

232-
} else if (playlistId.startsWith("RDAMVM") || playlistId.startsWith("RDCLAK")) { //Music mix
232+
} else if (isYoutubeMusicMixId(playlistId)) { // starts with "RDAMVM" or "RDCLAK"
233233
return playlistId.substring(6);
234234

235-
} else if (playlistId.startsWith("RMCM")) { //Channel mix
236-
//Channel mix are build with RMCM{channelId}, so videoId can't be determined
235+
} else if (isYoutubeChannelMixId(playlistId)) { // starts with "RMCM"
236+
// Channel mix are build with RMCM{channelId}, so videoId can't be determined
237237
throw new ParsingException("Video id could not be determined from mix id: " + playlistId);
238238

239-
} else if (playlistId.startsWith("RD")) { // Normal mix
239+
} else if (isYoutubeMixId(playlistId)) { // normal mix, starts with "RD"
240240
return playlistId.substring(2);
241241

242-
} else { //not a mix
242+
} else { // not a mix
243243
throw new ParsingException("Video id could not be determined from mix id: " + playlistId);
244244
}
245245
}

0 commit comments

Comments
 (0)