[YouTube] Support playlists as URL navigation endpoints

pull/1169/head
AudricV 2024-03-23 23:44:38 +01:00
rodzic 944d3723cd
commit 5f0faf34d7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DA92EC7905614198
1 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -872,9 +872,15 @@ public final class YoutubeParsingHelper {
final String canonicalBaseUrl = browseEndpoint.getString("canonicalBaseUrl");
final String browseId = browseEndpoint.getString("browseId");
// All channel ids are prefixed with UC
if (browseId != null && browseId.startsWith("UC")) {
return "https://www.youtube.com/channel/" + browseId;
if (browseId != null) {
if (browseId.startsWith("UC")) {
// All channel IDs are prefixed with UC
return "https://www.youtube.com/channel/" + browseId;
} else if (browseId.startsWith("VL")) {
// All playlist IDs are prefixed with VL, which needs to be removed from the
// playlist ID
return "https://www.youtube.com/playlist?list=" + browseId.substring(2);
}
}
if (!isNullOrEmpty(canonicalBaseUrl)) {