如何通过Ruby将视频上传到YouTube?

时间:2015-02-10 03:33:25

标签: ruby upload youtube

我需要自动将视频文件从我的电脑上传到youtube,我使用ruby。

我试过gem youtube_it - 我有错误YouTubeIt::AuthenticationError: BadAuthentication - 我的行为:

client = YouTubeIt::Client.new(:username => "email@gmail.com", :password =>  "my_passwd", :dev_key => "developer_key")
client.video_upload(File.open("file_from_drive"), :title => "test",:description => 'test')

我还测试了从我的email@gmail.com my_passwd Google帐户手动上传视频 - 我运作良好。 Dev_key我来到这里 - http://code.google.com/apis/youtube/dashboard

然后我尝试了gem gdata - How to upload video on YouTube with Ruby

require 'gdata'
yt = GData::Client::YouTube.new
yt.clientlogin("email@gmail.com", "my_passwd")

引发错误

GData::Client::AuthorizationError: request error 403: Error=BadAuthentication Info=WebLoginRequired

那么,我应该如何自动上传视频?也许问题出现在我的谷歌帐户中?

0 个答案:

没有答案