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

问题描述 投票:1回答:0

我需要将视频文件从计算机自动上传到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帐户上?

ruby upload youtube
© www.soinside.com 2019 - 2024. All rights reserved.