youtube.subscriptions.list (api v3) - nextPageToken isn't available

前端 未结 3 677
广开言路
广开言路 2020-12-16 05:38

I\'m trying to get all channels from my subscriptions. But the \"nextPageToken\" isn\'t available.

The response should containing \"nextPageToken\":

(from de

3条回答
  •  醉梦人生
    2020-12-16 06:07

    Here is a JS snippet I came up with to generate pageTokens up to at least 1024, I cannot guarantee that it will produce anything valid beyond that as i could not find any service which will get me tokens for offsets > 450 to validate my guesses and assumptions.

    var d0 = "AEIMQUYcgkosw048";
    var d1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    var d2 = d1;
    var d1c = 0;
    var d2c = 0;
    var overflowSuffix = "Q";
    var direction = "AA";
    var d2OverflowCounter = 0;
    var pageSize = 50;
    
    for (i = 0; i < 1024; i++) {
      if (i % pageSize == 0) console.log("C" + d1.charAt((d1c / d0.length) % d1.length) + d0.charAt(i % d0.length) + overflowSuffix + direction, ":", i);
      if (++d1c % (1 << 8) == 0) d1c = 1 << 7;
      if (++d2c % (1 << 7) == 0) overflowSuffix = d2.charAt(++d2OverflowCounter) + "E";
    }

    (check developer tools / console to see generated codes)

提交回复
热议问题