mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2024-12-14 22:30:33 +05:30
[YouTube] Music Mix: Fix playlist not being accepted
Regression introduced by YouTube Mix support (#280)
This commit is contained in:
parent
b62144b49d
commit
3033c0b993
@ -205,12 +205,12 @@ public class YoutubeParsingHelper {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the given playlist id is a YouTube Music Mix (auto-generated playlist)
|
* Checks if the given playlist id is a YouTube Music Mix (auto-generated playlist)
|
||||||
* Ids from a YouTube Music Mix start with "RDAMVM"
|
* Ids from a YouTube Music Mix start with "RDAMVM" or "RDCLAK"
|
||||||
* @param playlistId
|
* @param playlistId
|
||||||
* @return Whether given id belongs to a YouTube Music Mix
|
* @return Whether given id belongs to a YouTube Music Mix
|
||||||
*/
|
*/
|
||||||
public static boolean isYoutubeMusicMixId(final String playlistId) {
|
public static boolean isYoutubeMusicMixId(final String playlistId) {
|
||||||
return playlistId.startsWith("RDAMVM");
|
return playlistId.startsWith("RDAMVM") || playlistId.startsWith("RDCLAK");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Checks if the given playlist id is a YouTube Channel Mix (auto-generated playlist)
|
* Checks if the given playlist id is a YouTube Channel Mix (auto-generated playlist)
|
||||||
@ -229,7 +229,7 @@ public class YoutubeParsingHelper {
|
|||||||
if (playlistId.startsWith("RDMM")) { //My Mix
|
if (playlistId.startsWith("RDMM")) { //My Mix
|
||||||
return playlistId.substring(4);
|
return playlistId.substring(4);
|
||||||
|
|
||||||
} else if (playlistId.startsWith("RDAMVM")) { //Music mix
|
} else if (playlistId.startsWith("RDAMVM") || playlistId.startsWith("RDCLAK")) { //Music mix
|
||||||
return playlistId.substring(6);
|
return playlistId.substring(6);
|
||||||
|
|
||||||
} else if (playlistId.startsWith("RMCM")) { //Channel mix
|
} else if (playlistId.startsWith("RMCM")) { //Channel mix
|
||||||
|
@ -111,7 +111,8 @@ public class YoutubeService extends StreamingService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PlaylistExtractor getPlaylistExtractor(final ListLinkHandler linkHandler) {
|
public PlaylistExtractor getPlaylistExtractor(final ListLinkHandler linkHandler) {
|
||||||
if (YoutubeParsingHelper.isYoutubeMixId(linkHandler.getId())) {
|
if (YoutubeParsingHelper.isYoutubeMixId(linkHandler.getId())
|
||||||
|
&& !YoutubeParsingHelper.isYoutubeMusicMixId(linkHandler.getId())) {
|
||||||
return new YoutubeMixPlaylistExtractor(this, linkHandler);
|
return new YoutubeMixPlaylistExtractor(this, linkHandler);
|
||||||
} else {
|
} else {
|
||||||
return new YoutubePlaylistExtractor(this, linkHandler);
|
return new YoutubePlaylistExtractor(this, linkHandler);
|
||||||
|
@ -52,11 +52,6 @@ public class YoutubePlaylistLinkHandlerFactory extends ListLinkHandlerFactory {
|
|||||||
"the list-ID given in the URL does not match the list pattern");
|
"the list-ID given in the URL does not match the list pattern");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (YoutubeParsingHelper.isYoutubeMusicMixId(listID)) {
|
|
||||||
throw new ContentNotSupportedException(
|
|
||||||
"YouTube Music Mix playlists are not yet supported");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (YoutubeParsingHelper.isYoutubeChannelMixId(listID)
|
if (YoutubeParsingHelper.isYoutubeChannelMixId(listID)
|
||||||
&& Utils.getQueryValue(urlObj, "v") == null) {
|
&& Utils.getQueryValue(urlObj, "v") == null) {
|
||||||
//Video id can't be determined from the channel mix id. See YoutubeParsingHelper#extractVideoIdFromMixId
|
//Video id can't be determined from the channel mix id. See YoutubeParsingHelper#extractVideoIdFromMixId
|
||||||
|
Loading…
Reference in New Issue
Block a user