Advertisement
LianSheng

2022Q4_JS - YouTube API Test

Nov 29th, 2022
657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (() => {
  2.     const body = {
  3.         "context": {
  4.             "client": {
  5.                 "clientName": "WEB",
  6.                 "clientVersion": "2.20221122.06.00",
  7.             }
  8.         },
  9.         "continuation": "Eg0SC3F5Y3FGMUNXY1hnGAYyJSIRIgtxeWNxRjFDV2NYZzAAeAJCEGNvbW1lbnRzLXNlY3Rpb24%3D"
  10.     };
  11.  
  12.     fetch("https://www.youtube.com/youtubei/v1/next?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false", {
  13.         "referrer": "https://www.youtube.com/watch?v=qycqF1CWcXg",
  14.         "referrerPolicy": "origin-when-cross-origin",
  15.         "body": JSON.stringify(body),
  16.         "method": "POST",
  17.         "mode": "cors",
  18.         "credentials": "include"
  19.     }).then(
  20.         r => r.json()
  21.     ).then(
  22.         r => console.log(r.onResponseReceivedEndpoints[1].reloadContinuationItemsCommand.continuationItems[0].commentThreadRenderer.comment.commentRenderer.authorText.simpleText)
  23.     );
  24. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement