我試圖使用youtube數據API將本地視頻文件上傳到我的YouTube帳戶。使用YouTube將視頻上傳到YouTube數據API:損壞的管道(Errno :: EPIPE)
實施例:https://github.com/youtube/api-samples/blob/master/ruby/upload_video.rb
呼叫:
$ ruby upload_video.rb --file video.mp4
我得到的錯誤消息:
/Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/openssl/buffering.rb:326:in `syswrite': Broken pipe (Errno::EPIPE)
from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/openssl/buffering.rb:326:in `do_write'
from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/openssl/buffering.rb:344:in `write'
from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http/generic_request.rb:202:in `copy_stream'
from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http/generic_request.rb:202:in `send_request_with_body_stream'
from /Users/user/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http/generic_request.rb:132:in `exec'
...
from upload_video.rb:73:in `main'
from upload_video.rb:91:in `<main>'
upload_video.rb(線73):
videos_insert_response = client.execute!(
:api_method => youtube.videos.insert,
:body_object => body,
:media => Google::APIClient::UploadIO.new(opts[:file], 'video/*'),
:parameters => {
:uploadType => 'resumable',
:part => body.keys.join(',')
}
)
任何運氣?我正面臨着類似的問題。上傳音頻文件時發生在我身上。 – Chirantan
@Chirantan其實是的。查看解決方案。祝你好運 – BearGrylls