youtube-studio icon indicating copy to clipboard operation
youtube-studio copied to clipboard

Cannot read property 'Symbol(Request internals)' of null

Open imReCoder opened this issue 2 years ago • 2 comments

const SID= y_cred.SID; const HSID = y_cred.HSID; const SSID = y_cred.SSID; const APISID = y_cred.APISID; const SAPISID = y_cred.SAPISID;

async () => { try { await init({ SID, HSID, SSID, APISID, SAPISID, }); } catch (err) { console.log("error in youtube auth..",err.message) } };

const result = await upload({ channelId: environment.CHANNEL_ID, // your channelId stream:fs.createReadStream("./videos/" + info.videoId + ".mp4"), // your video stream

  newTitle:vData.title, // optional, your video name
  newDescription:vData.description,
  newPrivacy: "PUBLIC", // optional (PRIVATE by default), ('PUBLIC', 'UNLISTED', 'PRIVATE' options available)
  isDraft: false // optional, video can be a draft (false by default)
});

ERROR GOT: TypeError: Cannot read property 'Symbol(Request internals)' of null 2021-07-09T21:53:25.012471071Z at isRequest (/app/node_modules/node-fetch/lib/index.js:1158:50) 2021-07-09T21:53:25.012478175Z at new Request (/app/node_modules/node-fetch/lib/index.js:1180:8) 2021-07-09T21:53:25.012482824Z at /app/node_modules/node-fetch/lib/index.js:1409:19 2021-07-09T21:53:25.012487102Z at new Promise () 2021-07-09T21:53:25.013374012Z at fetch (/app/node_modules/node-fetch/lib/index.js:1407:9) 2021-07-09T21:53:25.013379083Z at uploadFile (/app/node_modules/youtube-studio/src/upload/index.js:33:16) 2021-07-09T21:53:25.013383040Z at upload (/app/node_modules/youtube-studio/src/upload/index.js:68:36) 2021-07-09T21:53:25.013387018Z at runMicrotasks () 2021-07-09T21:53:25.013390955Z at processTicksAndRejections (internal/proces

imReCoder avatar Jul 09 '21 21:07 imReCoder

can you please wrap upload function with try/catch?

adasq avatar Jan 19 '22 11:01 adasq

Hey there, I got the same issue today.

I found out that caused by missing SESSION_TOKEN when you call "init". And the upload function doesn't check this before passing it to node-fetch.

PR on #33

tyzesc avatar Jun 10 '22 08:06 tyzesc