3131import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .getClientVersion ;
3232import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .getJsonResponse ;
3333import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .getTextFromObject ;
34+ import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .getKey ;
3435import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .getUrlFromNavigationEndpoint ;
3536import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .getValidJsonResponseBody ;
3637import 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