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
Add YouTube upload examples #577
Comments
@bradorego I'm about to tread down this same path. Did you ever have any success? |
I had to dig through some old code (as I'm no longer working on this project) but I think this might be helpful? var uploadVideo = function (file, title, description) {
var d = $q.defer();
youtube.videos.insert({
part: 'snippet,status',
resource: {
snippet: {
title: title,
description: description
},
status: {
privacyStatus: "unlisted"
}
},
media: {
mimeType: file.mimetype,
body: fs.readFileSync(file.path)
}
}, function (err, result, response) {
if (err) {
console.error(err);
return d.reject(err);
}
del.sync([file.path]); /// clean up file after upload success
d.resolve(result);
}); /// end video upload
return d.promise;
}; Edit: Wow, that did not style nicely at all. Here's a gist: https://gist.github.com/bradorego/c9ea8b669d3b9d0914c4bf25184dcb3a |
Thank you, sir! That'll save me a good bit of time reading through the API re: |
Sorry there's no explicit example. I just looked, this library currently supports 4,227 API calls across 155 different Google APIs 😮 Luckily, the API reference documentation is complete for the Youtube API. Here's the relevant bit that details the properties available on the |
Thank you, @jmdobry. Here is a link to the settable properties of https://developers.google.com/youtube/v3/docs/videos/insert#parameters |
…ates (#577) Source-Author: Jeff Ching <chingor@google.com> Source-Date: Thu May 21 17:51:49 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 65f8c647c0bc0c6b38211b969a2a003e271a5ef1 Source-Link: googleapis/synthtool@65f8c64
…ates (#577) Source-Author: Jeff Ching <chingor@google.com> Source-Date: Thu May 21 17:51:49 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 65f8c647c0bc0c6b38211b969a2a003e271a5ef1 Source-Link: googleapis/synthtool@65f8c64
…ates (#577) Source-Author: Jeff Ching <chingor@google.com> Source-Date: Thu May 21 17:51:49 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 65f8c647c0bc0c6b38211b969a2a003e271a5ef1 Source-Link: googleapis/synthtool@65f8c64
…ates (#577) Source-Author: Jeff Ching <chingor@google.com> Source-Date: Thu May 21 17:51:49 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 65f8c647c0bc0c6b38211b969a2a003e271a5ef1 Source-Link: googleapis/synthtool@65f8c64
Nothing too fancy here, but I'm trying to use the YouTube API and I'm basically brute-forcing my way to success. I've got playlist creation down so far, and I can upload a video, but I haven't figured out how to set information about the video (e.g. title, privacy, etc) and it's really frustrating. This would be a lot easier if there were examples to work off of.
The text was updated successfully, but these errors were encountered: