我需要将视频文件从计算机自动上传到youtube,我使用的是ruby。
我尝试了gem youtube_it
我有错误YouTubeIt::AuthenticationError: BadAuthentication
我的动作:
client = YouTubeIt::Client.new(:username => "[email protected]", :password => "my_passwd", :dev_key => "developer_key")
client.video_upload(File.open("file_from_drive"), :title => "test",:description => 'test')
我还测试了从我的[email protected] my_passwd
Google帐户手动上传视频的方法-我工作得很好。 我到达这里的Dev_key- http://code.google.com/apis/youtube/dashboard
然后我在这里尝试了gem gdata
如何使用Ruby在YouTube上上传视频
require 'gdata'
yt = GData::Client::YouTube.new
yt.clientlogin("[email protected]", "my_passwd")
引发错误
GData::Client::AuthorizationError: request error 403: Error=BadAuthentication Info=WebLoginRequired
那么,我应该如何自动上传视频? 也许问题出在我的Google帐户上?