Hi, I am having troubles with direct API working, I am using net/http and net/https and am getting a Connection reset by peer error. I am including the full program code below and I hope somebody can spot what I am doing wrong.
ruby youtube_upload.rb DevID User Pass Video_Filename
Here is the program code:
require 'net/http' require 'net/https'
if ( ARGV.size < 4 ) print "\nUsage: ruby youtube_upload.rb <DevID> <User> <Pass> <Filename>\n\n" exit end
dev_id = ARGV[0] user = ARGV[1] pass = ARGV[2] @file = ARGV[3]
auth_host = 'www.google.com' auth_path = '/youtube/accounts/ClientLogin' upload_host = 'uploads.gdata.youtube.com' upload_path = "/feeds/api/users/#{user}/uploads" video_file = "/home/gmd/vtrack/#{@file}"
if ( !File.exists? video_file ) print "\nError: Invalid video filename specified\n\n" exit end