私は公式のGoogle API ノード クライアントである程度の前進を遂げましたが、動画ファイルを YouTube にアップする方法を考え出すのに少し行き詰まりました。
私はビデオを持っています:example.mp4
私はこのコードを持っています:
OAuth2Client = googleapis.OAuth2Client;
var oauth2Client = new OAuth2Client('XXXXXX', 'XXXXXXX', 'http://callback_url');
googleapis.discover('youtube', 'v3').execute(function(err, client) {
if (err) console.log(err);
// I think the following is the bones of what I want to do
client.youtube.videos.insert({}).execute(function(err, client) {
if (err) console.log(err);
});
});
挿入メソッドを使用してエラーが発生するだけで(パラメーターが渡されないと予想されました)、クライアントは初期化されて正常に戻ります。
ビデオ (スクリプトと同じディレクトリ内) を YouTube に渡す方法がわかりません。ポインタだけでも大歓迎です。