File tree Expand file tree Collapse file tree
src/main/java/com/github/felipeucelli/javatube Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,11 +72,23 @@ protected JSONObject getJson() throws Exception {
7272 }
7373
7474 protected void setContinuationToken (JSONArray importantContent ) throws JSONException {
75- continuationToken = importantContent .getJSONObject (importantContent .length () - 1 )
75+ JSONObject continuationEndpoint = importantContent .getJSONObject (importantContent .length () - 1 )
7676 .getJSONObject ("continuationItemRenderer" )
77- .getJSONObject ("continuationEndpoint" )
78- .getJSONObject ("continuationCommand" )
79- .getString ("token" );
77+ .getJSONObject ("continuationEndpoint" );
78+
79+ if (continuationEndpoint .has ("continuationCommand" )){
80+ continuationToken = continuationEndpoint
81+ .getJSONObject ("continuationCommand" )
82+ .getString ("token" );
83+
84+ }else if (continuationEndpoint .has ("commandExecutorCommand" )){
85+ continuationToken = continuationEndpoint
86+ .getJSONObject ("commandExecutorCommand" )
87+ .getJSONArray ("commands" )
88+ .getJSONObject (1 )
89+ .getJSONObject ("continuationCommand" )
90+ .getString ("token" );
91+ }
8092 }
8193
8294 protected JSONArray extractContinuationItems (JSONArray importantContent ) throws Exception {
You can’t perform that action at this time.
0 commit comments