Skip to content

Commit 668b080

Browse files
FireMasterKXiangRongLin
authored andcommitted
Use dynamic key.
1 parent 43b46bd commit 668b080

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getClientVersion;
3232
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getJsonResponse;
3333
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getTextFromObject;
34+
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getKey;
3435
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getUrlFromNavigationEndpoint;
3536
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.getValidJsonResponseBody;
3637
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.toJsonObject;
@@ -179,7 +180,7 @@ public String getSubChannelAvatarUrl() {
179180

180181
@Nonnull
181182
@Override
182-
public InfoItemsPage<StreamInfoItem> getInitialPage() {
183+
public InfoItemsPage<StreamInfoItem> getInitialPage() throws IOException, ExtractionException {
183184
final StreamInfoItemsCollector collector = new StreamInfoItemsCollector(getServiceId());
184185
Page nextPage = null;
185186

@@ -246,7 +247,7 @@ public InfoItemsPage<StreamInfoItem> getPage(final Page page) throws IOException
246247
return new InfoItemsPage<>(collector, getNextPageFrom(continuation));
247248
}
248249

249-
private Page getNextPageFrom(final JsonArray contents) {
250+
private Page getNextPageFrom(final JsonArray contents) throws IOException, ExtractionException {
250251
if (isNullOrEmpty(contents)) {
251252
return null;
252253
}
@@ -259,7 +260,7 @@ private Page getNextPageFrom(final JsonArray contents) {
259260
.getObject("continuationCommand")
260261
.getString("token");
261262
return new Page(
262-
"https://www.youtube.com/youtubei/v1/browse?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",
263+
"https://www.youtube.com/youtubei/v1/browse?key=" + getKey(),
263264
continuation);
264265
} else {
265266
return null;

0 commit comments

Comments
 (0)