Closed utterances-bot closed 10 months ago
Waiting for your comments on this one!
Hello,
I have problem with last step. How exactly call method uploadVideo?
Hey,
You can do something like:
uploadVideo(
auth, // which is the result of the authorize method, you need to call prior to this
(error, videoID) => {
if(error) {
return console.error(error);
}
return console.log('Success upload, video ID is ' + videoID);
}
)
Let me know if that helps!
I have this error : errors: [ { message: 'Login Required.', domain: 'global', reason: 'required', location: 'Authorization', debugInfo: 'Authentication error: missing credentials.', locationType: 'header' } ] }
Can you help me ?
Problem solved.
Problem solved.
Sorry, I wasn't quick enough :sweat_smile:
In index.js: cb is not defined.... how can i define that?
cb is usually a function like (error, result) => {console.log(error, result)}
If you give more context about your issue, I think I can give a better advice.
Great article! How would i add support for multiple youtube accounts? (on the same email, if that matters, accessable here: https://www.youtube.com/channel_switcher)
@Glutch Instead of storing one token in a file you could store them all in a JSON file for instance.
Something like:
{
"account1" : "token",
"account2" : "token2"
}
Then you could add a new param to your program to define which account you want to use. Is that clear?
@Mikescops Thank you, that worked nicely. However, i got quite a big problem. Whenever i upload a video with this script it gets automatically locked and privated, with a message about policy. With the only option to apply for an appeal. If i try to appeal i am instantly greeted with "This violation cannot be appealed". I have never before tinkered with the youtube api or done any spooky spam related things.
In the response from service.videos.insert i get status 200 with no error messages.
Now, if i upload the exact same video manually, to the same account, through youtube studio, the video is approved, public, no problems
@Glutch I don't know about this issue, it's mostly related to YouTube policy than the API, maybe you can ask this question to the YouTube support team. If you get any answer, please share here, I'm interested to know!
In index.js: cb is not defined.... how can i define that?
Hey @onecodestar give examples of how you implement it!
How is structure file look like ?
I have this error : errors: [ { message: 'Login Required.', domain: 'global', reason: 'required', location: 'Authorization', debugInfo: 'Authentication error: missing credentials.', locationType: 'header' } ] }
Can you help me ?
Hi! I have a question. Does the callback function that the insert method accepts is fired after the uploading is done? Because i've uploaded this on an API route and it takes quite long before returning anything. If that's so then how do i return a response as soon as the uploading begins and show the progress as it continues? I am uploading directly from a server to YouTube, so nothing is being uploaded from client.
How to upload a video on Youtube with NodeJS | PixelSwap
I recently worked on a simple project for a Twitter user that wanted a way to reshare videos over Youtube. The Google documentation was not really clear so …
https://pixelswap.fr/entry/how-to-upload-a-video-on-youtube-with-nodejs