Skip to content

Commit 7f2e358

Browse files
committed
fixup: return playlist url instead of id
1 parent b0d7dea commit 7f2e358

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMusicSongOrVideoInfoItemExtractor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public List<Image> getThumbnails() throws ParsingException {
176176
}
177177

178178
@Override
179-
public String getPlaylistId() throws ParsingException {
179+
public String getPlaylistUrl() throws ParsingException {
180180
if (searchType.equals(MUSIC_SONGS)) {
181181
for (final Object item : descriptionElements) {
182182
final JsonObject browseEndpoint = ((JsonObject) item)
@@ -189,7 +189,7 @@ public String getPlaylistId() throws ParsingException {
189189
.getString("pageType");
190190

191191
if (type != null && type.equals("MUSIC_PAGE_TYPE_ALBUM")) {
192-
return browseEndpoint.getString("browseId");
192+
return "https://music.youtube.com/browse/" + browseEndpoint.getString("browseId");
193193
}
194194
}
195195
}

extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItem.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class StreamInfoItem extends InfoItem {
3737
private String uploaderName;
3838
private String shortDescription;
3939
private String textualUploadDate;
40-
private String playlistId;
40+
private String playlistUrl;
4141
@Nullable
4242
private DateWrapper uploadDate;
4343
private long viewCount = -1;
@@ -119,12 +119,12 @@ public void setTextualUploadDate(final String textualUploadDate) {
119119
this.textualUploadDate = textualUploadDate;
120120
}
121121

122-
public String getPlaylistId() {
123-
return playlistId;
122+
public String getPlaylistUrl() {
123+
return playlistUrl;
124124
}
125125

126-
public void setPlaylistId(final String playlistId) {
127-
this.playlistId = playlistId;
126+
public void setPlaylistUrl(final String playlistUrl) {
127+
this.playlistUrl = playlistUrl;
128128
}
129129

130130
@Nullable

extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemExtractor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ default boolean isShortFormContent() throws ParsingException {
149149
}
150150

151151
/**
152-
* Gets the playlist id of the stream item.
152+
* Gets the playlist url of the stream item.
153153
*
154-
* @return the playlist id of the stream item.
154+
* @return the playlist url of the stream item.
155155
* @throws ParsingException if there is an error in the extraction
156156
*/
157-
default String getPlaylistId() throws ParsingException {
157+
default String getPlaylistUrl() throws ParsingException {
158158
return "";
159159
}
160160
}

extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemsCollector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public StreamInfoItem extract(final StreamInfoItemExtractor extractor) throws Pa
104104
addError(e);
105105
}
106106
try {
107-
resultItem.setPlaylistId(extractor.getPlaylistId());
107+
resultItem.setPlaylistUrl(extractor.getPlaylistUrl());
108108
} catch (final Exception e) {
109109
addError(e);
110110
}

0 commit comments

Comments
 (0)