youtube_it 2.1.8 → 2.1.10

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -272,7 +272,7 @@ List Response Videos
272
272
 
273
273
  When uploading a video from your browser you need make a form upload with the followings params:
274
274
  $ upload_token(params, nexturl)
275
- params => params like :title => "title", :description => "description", :category => "People", :tags => ["test"]
275
+ params => params like :title => "title", :description => "description", :category => "People", :keywords => ["test"]
276
276
  nexturl => redirect to this url after upload
277
277
 
278
278
 
@@ -313,13 +313,17 @@ YouTubeIt passes all logs through the logger variable on the class itself. In Ra
313
313
  $ YouTubeIt.logger = RAILS_DEFAULT_LOGGER
314
314
  $ RAILS_DEFAULT_LOGGER.level = Logger::DEBUG
315
315
 
316
- == CONTRIBUTORS:
316
+ == AUTHORS:
317
317
 
318
318
  * Kyle J. Ginavan.
319
319
  * Mauro Torres - http://github.com/chebyte
320
+
321
+ == CONTRIBUTORS:
322
+
320
323
  * Marko Seppa - https://github.com/mseppae
321
324
  * Walter Korman - https://github.com/shaper
322
325
  * Shane Vitarana - https://github.com/shanev
326
+ * Adrien Jarthon - https://github.com/jarthod
323
327
 
324
328
  == LICENSE:
325
329
 
@@ -1,5 +1,5 @@
1
- module Faraday
2
- class Request::AuthHeader < Faraday::Middleware
1
+ module FaradayMiddleware
2
+ class YoutubeAuthHeader < Faraday::Middleware
3
3
 
4
4
  def call(env)
5
5
  req_headers = env[:request_headers]
@@ -1,5 +1,5 @@
1
- module Faraday
2
- class Request::OAuth < Faraday::Middleware
1
+ module FaradayMiddleware
2
+ class YoutubeOAuth < Faraday::Middleware
3
3
  dependency 'simple_oauth'
4
4
 
5
5
  def call(env)
@@ -1,5 +1,5 @@
1
- module Faraday
2
- class Request::OAuth2 < Faraday::Middleware
1
+ module FaradayMiddleware
2
+ class YoutubeOAuth2 < Faraday::Middleware
3
3
  def call(env)
4
4
  env[:request_headers]['Authorization'] = "Bearer #{@access_token.token}"
5
5
 
@@ -20,7 +20,7 @@ module Faraday
20
20
  end
21
21
 
22
22
  def on_complete(env) #this method is called after finish request
23
- msg = env[:body] ? parse_upload_error_from(env[:body].gsub(/\n/, '')) : ''
23
+ msg = env[:body] ? parse_upload_error_from((env[:body] || '').gsub(/\n/, '')) : ''
24
24
  if env[:status] == 403 || env[:status] == 401
25
25
  raise ::AuthenticationError.new(msg, env[:status])
26
26
  elsif (env[:status] / 10).to_i != 20
@@ -32,7 +32,7 @@ class YouTubeIt
32
32
  end
33
33
 
34
34
  def remove_bom str
35
- str.gsub /\xEF\xBB\xBF|/, ''
35
+ str.gsub /\xEF\xBB\xBF|/, '' if str
36
36
  end
37
37
  end
38
38
 
@@ -91,7 +91,7 @@ class YouTubeIt
91
91
  upload_url = "/feeds/api/users/default/uploads"
92
92
  response = yt_session(uploads_url).post(upload_url, post_body_io, upload_header)
93
93
 
94
- return YouTubeIt::Parser::VideoFeedParser.new(response.body).parse
94
+ return YouTubeIt::Parser::VideoFeedParser.new(response.body).parse rescue nil
95
95
  end
96
96
 
97
97
  # Updates a video in YouTube. Requires:
@@ -112,7 +112,7 @@ class YouTubeIt
112
112
  update_url = "/feeds/api/users/default/uploads/%s" % video_id
113
113
  response = yt_session.put(update_url, update_body)
114
114
 
115
- return YouTubeIt::Parser::VideoFeedParser.new(response.body).parse
115
+ return YouTubeIt::Parser::VideoFeedParser.new(response.body).parse rescue nil
116
116
  end
117
117
 
118
118
 
@@ -167,7 +167,7 @@ class YouTubeIt
167
167
  get_url = "/feeds/api/users/default/uploads/%s" % video_id
168
168
  response = yt_session.get(get_url)
169
169
 
170
- return YouTubeIt::Parser::VideoFeedParser.new(response.body).parse
170
+ return YouTubeIt::Parser::VideoFeedParser.new(response.body).parse rescue nil
171
171
  end
172
172
 
173
173
  # Fetches the data of the videos of the current user, which may be private.
@@ -637,12 +637,12 @@ class YouTubeIt
637
637
  Faraday.new(:url => (url ? url : base_url), :ssl => {:verify => false}) do |builder|
638
638
  if @access_token
639
639
  if @config_token
640
- builder.use Faraday::Request::OAuth, @config_token
640
+ builder.use FaradayMiddleware::YoutubeOAuth, @config_token
641
641
  else
642
- builder.use Faraday::Request::OAuth2, @access_token
642
+ builder.use FaradayMiddleware::YoutubeOAuth2, @access_token
643
643
  end
644
644
  end
645
- builder.use Faraday::Request::AuthHeader, authorization_headers
645
+ builder.use FaradayMiddleware::YoutubeAuthHeader, authorization_headers
646
646
  builder.use Faraday::Response::YouTubeIt
647
647
  builder.adapter YouTubeIt.adapter
648
648
 
@@ -1,4 +1,4 @@
1
1
  class YouTubeIt
2
- VERSION = '2.1.8'
2
+ VERSION = '2.1.10'
3
3
  end
4
4
 
data/youtube_it.gemspec CHANGED
@@ -8,8 +8,8 @@ require File.dirname(__FILE__) + "/lib/youtube_it/version"
8
8
  Gem::Specification.new do |s|
9
9
  s.name = "youtube_it"
10
10
  s.version = YouTubeIt::VERSION
11
- s.authors = %w(kylejginavan chebyte mseppae)
12
- s.email = %w(kylejginavan@gmail.com)
11
+ s.authors = %w(kylejginavan chebyte)
12
+ s.email = %w(kylejginavan@gmail.com maurotorres@gmail.com)
13
13
  s.description = "Upload, delete, update, comment on youtube videos all from one gem."
14
14
  s.summary = "The most complete Ruby wrapper for youtube api's"
15
15
  s.homepage = "http://github.com/kylejginavan/youtube_it"
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.add_runtime_dependency("nokogiri", "~> 1.5.2")
18
18
  s.add_runtime_dependency("oauth", "~> 0.4.4")
19
19
  s.add_runtime_dependency("oauth2", "~> 0.6")
20
- s.add_runtime_dependency("simple_oauth", "~> 0.1.5")
20
+ s.add_runtime_dependency("simple_oauth", ">= 0.1.5")
21
21
  s.add_runtime_dependency("faraday", "~> 0.8")
22
22
  s.add_runtime_dependency("builder", ">= 0")
23
23
 
metadata CHANGED
@@ -2,17 +2,16 @@
2
2
  name: youtube_it
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.1.8
5
+ version: 2.1.10
6
6
  platform: ruby
7
7
  authors:
8
8
  - kylejginavan
9
9
  - chebyte
10
- - mseppae
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
13
 
15
- date: 2012-11-10 00:00:00 Z
14
+ date: 2013-01-10 00:00:00 Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
17
  name: nokogiri
@@ -53,7 +52,7 @@ dependencies:
53
52
  requirement: &id004 !ruby/object:Gem::Requirement
54
53
  none: false
55
54
  requirements:
56
- - - ~>
55
+ - - ">="
57
56
  - !ruby/object:Gem::Version
58
57
  version: 0.1.5
59
58
  type: :runtime
@@ -83,6 +82,7 @@ dependencies:
83
82
  description: Upload, delete, update, comment on youtube videos all from one gem.
84
83
  email:
85
84
  - kylejginavan@gmail.com
85
+ - maurotorres@gmail.com
86
86
  executables: []
87
87
 
88
88
  extensions: []