Skip to content

Commit 9fa8d4c

Browse files
committed
[YouTube] Support playlists as URL navigation endpoints
1 parent c99d94b commit 9fa8d4c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -825,9 +825,15 @@ public static String getUrlFromNavigationEndpoint(
825825
final String canonicalBaseUrl = browseEndpoint.getString("canonicalBaseUrl");
826826
final String browseId = browseEndpoint.getString("browseId");
827827

828-
// All channel ids are prefixed with UC
829-
if (browseId != null && browseId.startsWith("UC")) {
830-
return "https://www.youtube.com/channel/" + browseId;
828+
if (browseId != null) {
829+
if (browseId.startsWith("UC")) {
830+
// All channel IDs are prefixed with UC
831+
return "https://www.youtube.com/channel/" + browseId;
832+
} else if (browseId.startsWith("VL")) {
833+
// All playlist IDs are prefixed with VL, which needs to be removed from the
834+
// playlist ID
835+
return "https://www.youtube.com/playlist?list=" + browseId.substring(2);
836+
}
831837
}
832838

833839
if (!isNullOrEmpty(canonicalBaseUrl)) {

0 commit comments

Comments
 (0)