I've not found answer for this question and I am not able to upload video to youtube by Ruby.
I am using "Upload a video" from https://developers.google.com/youtube/v3/code_samples/ruby
JSON file with client-ID, secret etc. was generated from google developers console and contains proper data.
C:\Projects\youtube>C:\Ruby\bin\ruby.exe C:/Projects/youtube/upload.rb --file VID_20131207_172637_752.mp4
C:/Ruby/lib/ruby/gems/2.2.0/gems/signet-0.6.0/lib/signet/oauth_2/client.rb:1009:in `generate_authenticated_request': Missing access token. (ArgumentError)
from C:/Ruby/lib/ruby/gems/2.2.0/gems/google-api-client-0.8.6/lib/google/api_client/request.rb:241:in `to_env'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/google-api-client-0.8.6/lib/google/api_client/request.rb:161:in `send'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/google-api-client-0.8.6/lib/google/api_client.rb:648:in `block (2 levels) in execute!'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/retriable-1.4.1/lib/retriable/retry.rb:27:in `perform'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/retriable-1.4.1/lib/retriable.rb:15:in `retriable'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/google-api-client-0.8.6/lib/google/api_client.rb:645:in `block in execute!'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/retriable-1.4.1/lib/retriable/retry.rb:27:in `perform'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/retriable-1.4.1/lib/retriable.rb:15:in `retriable'
from C:/Ruby/lib/ruby/gems/2.2.0/gems/google-api-client-0.8.6/lib/google/api_client.rb:636:in `execute!'
from C:/Projects/youtube/upload.rb:75:in `main'
from C:/Projects/youtube/upload.rb:93:in `<main>'
Any case from this post Why does Google's Custom Search API say that I'm missing an access token when using the Ruby client? do not give positive results.
When i try to use client.authorization = nil
I get following reply from google:
C:\Projects\youtube>C:\Ruby\bin\ruby.exe C:/Projects/youtube/upload.rb --file VID_20131207_172637_752.mp4
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Login Required"
}
}
Platform:
Win7 64bit
ruby 2.2.1p85 (2015-02-26 revision 49769) [x64-mingw32]
google-api-client (0.8.6) - also I tried 0.9.pre3 and get the same behavior.
When debugging client.authorization and file_storage.authorization objects contain uninitialized data.
What am I doing wrong?