Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
imReCoder opened this issue Jul 9, 2021 · 2 comments
Open

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

imReCoder opened this issue Jul 9, 2021 · 2 comments

Comments

@imReCoder
Copy link

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

@adasq
Copy link
Owner

adasq commented Jan 19, 2022

can you please wrap upload function with try/catch?

@tyzesc
Copy link
Contributor

tyzesc commented Jun 10, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants