youtube_it 2.4.0 → 2.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +3 -2
- data/lib/youtube_it/client.rb +1 -1
- data/lib/youtube_it/model/playlist.rb +1 -1
- data/lib/youtube_it/model/video.rb +2 -0
- data/lib/youtube_it/parser.rb +2 -0
- data/lib/youtube_it/request/video_upload.rb +6 -2
- data/lib/youtube_it/version.rb +1 -1
- data/youtube_it.gemspec +4 -5
- metadata +197 -173
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ea702383572e46712f8190745fb3e5c6bbb6aab7
|
4
|
+
data.tar.gz: d5626b52a4466bbc666ccb929183224da5a7040f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: dd6266ca7d7fadd0e61548b6d3ee47dff4ffedb0fddce584321c567d9b455e665330b60fd7bba4ad0889cabb200180bc20e2568f0a8dbc59dd25f4cb5dcf9e43
|
7
|
+
data.tar.gz: 83960eddcec401fcba13f5c49a5d1a7e374af49ba73ae547b5413f998eaf30c8248fc71609e908bdd6adbc2ef91cbc0193536933cf3d64a85cad1c64f70e3ad3
|
data/README.rdoc
CHANGED
@@ -79,6 +79,7 @@ Basic Queries:
|
|
79
79
|
$ client.videos_by(:query => "penguin")
|
80
80
|
$ client.videos_by(:query => "penguin", :page => 2, :per_page => 15)
|
81
81
|
$ client.videos_by(:query => "penguin", :restriction => "DE")
|
82
|
+
$ client.videos_by(:query => "penguin", :author => "liz")
|
82
83
|
$ client.videos_by(:tags => ['tiger', 'leopard'])
|
83
84
|
$ client.videos_by(:categories => [:news, :sports])
|
84
85
|
$ client.videos_by(:categories => [:news, :sports], :tags => ['soccer', 'football'])
|
@@ -121,8 +122,8 @@ Fields Parameter(experimental features):
|
|
121
122
|
$ client.videos_by(:fields => {:recorded => ((Date.today - 30)..(Date.today))})
|
122
123
|
|
123
124
|
Note: These queries do not find private videos! Use these methods instead:
|
124
|
-
$ client.
|
125
|
-
$ client.
|
125
|
+
$ client.my_video("FQK1URcxmb4")
|
126
|
+
$ client.my_videos(:query => "penguin")
|
126
127
|
|
127
128
|
== VIDEO MANAGEMENT
|
128
129
|
|
data/lib/youtube_it/client.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class YouTubeIt
|
2
2
|
module Model
|
3
3
|
class Playlist < YouTubeIt::Record
|
4
|
-
attr_reader :title, :description, :summary, :playlist_id, :xml, :published, :response_code
|
4
|
+
attr_reader :title, :description, :summary, :author, :videos_count, :playlist_id, :xml, :published, :response_code
|
5
5
|
def videos
|
6
6
|
YouTubeIt::Parser::VideosFeedParser.new(@xml).parse_videos
|
7
7
|
end
|
@@ -9,6 +9,8 @@ class YouTubeIt
|
|
9
9
|
# Describes the various file formats in which a Youtube video may be
|
10
10
|
# made available and allows looking them up by format code number.
|
11
11
|
class Format
|
12
|
+
attr_reader :format_code, :name
|
13
|
+
|
12
14
|
@@formats = Hash.new
|
13
15
|
|
14
16
|
# Instantiates a new video format object.
|
data/lib/youtube_it/parser.rb
CHANGED
@@ -84,8 +84,10 @@ class YouTubeIt
|
|
84
84
|
:title => entry.at("title") && entry.at("title").text,
|
85
85
|
:summary => ((entry.at("summary") || entry.at_xpath("media:group").at_xpath("media:description")).text rescue nil),
|
86
86
|
:description => ((entry.at("summary") || entry.at_xpath("media:group").at_xpath("media:description")).text rescue nil),
|
87
|
+
:author => (entry.at("author name").text rescue nil),
|
87
88
|
:playlist_id => (entry.at("id").text[/playlist:([\w\-]+)/, 1] rescue nil),
|
88
89
|
:published => entry.at("published") ? entry.at("published").text : nil,
|
90
|
+
:videos_count => (entry.at_xpath("openSearch:totalResults").text rescue nil),
|
89
91
|
:response_code => content.status,
|
90
92
|
:xml => content.body)
|
91
93
|
end
|
@@ -231,7 +231,7 @@ class YouTubeIt
|
|
231
231
|
reply_to = reply_to.unique_id if reply_to.is_a? YouTubeIt::Model::Comment
|
232
232
|
comment_body = comment_xml_for(:comment => comment, :reply_to => reply_to_url(video_id, reply_to))
|
233
233
|
comment_url = "/feeds/api/videos/%s/comments" % video_id
|
234
|
-
response = yt_session.post(comment_url, comment_body)
|
234
|
+
response = yt_session(base_ssl_url).post(comment_url, comment_body)
|
235
235
|
comment = YouTubeIt::Parser::CommentsFeedParser.new(response.body).parse_single_entry
|
236
236
|
return {:code => response.status, :body => response.body, :comment => comment}
|
237
237
|
end
|
@@ -239,7 +239,7 @@ class YouTubeIt
|
|
239
239
|
def delete_comment(video_id, comment_id)
|
240
240
|
comment_id = comment_id.unique_id if comment_id.is_a? YouTubeIt::Model::Comment
|
241
241
|
url = "/feeds/api/videos/%s/comments/%s" % [video_id, comment_id]
|
242
|
-
response = yt_session.delete(url)
|
242
|
+
response = yt_session(base_ssl_url).delete(url)
|
243
243
|
|
244
244
|
return response.status == 200
|
245
245
|
end
|
@@ -522,6 +522,10 @@ class YouTubeIt
|
|
522
522
|
"http://gdata.youtube.com"
|
523
523
|
end
|
524
524
|
|
525
|
+
def base_ssl_url
|
526
|
+
"https://gdata.youtube.com"
|
527
|
+
end
|
528
|
+
|
525
529
|
def boundary
|
526
530
|
"An43094fu"
|
527
531
|
end
|
data/lib/youtube_it/version.rb
CHANGED
data/youtube_it.gemspec
CHANGED
@@ -16,15 +16,14 @@ Gem::Specification.new do |s|
|
|
16
16
|
|
17
17
|
s.add_runtime_dependency("nokogiri", "~> 1.6.0")
|
18
18
|
s.add_runtime_dependency("oauth", "~> 0.4.4")
|
19
|
-
s.add_runtime_dependency("oauth2", "~> 0.
|
19
|
+
s.add_runtime_dependency("oauth2", "~> 1.0.0")
|
20
20
|
s.add_runtime_dependency("simple_oauth", ">= 0.1.5")
|
21
|
-
s.add_runtime_dependency("faraday",
|
21
|
+
s.add_runtime_dependency("faraday", ['>= 0.8', '< 0.10'])
|
22
22
|
s.add_runtime_dependency("builder", ">= 0")
|
23
|
-
s.add_runtime_dependency("webmock")
|
24
23
|
s.add_runtime_dependency("excon")
|
25
|
-
s.add_runtime_dependency("json", "~> 1.
|
24
|
+
s.add_runtime_dependency("json", "~> 1.8")
|
25
|
+
s.add_development_dependency("webmock")
|
26
26
|
s.files = Dir.glob("lib/**/*") + %w(README.rdoc youtube_it.gemspec)
|
27
27
|
|
28
28
|
s.extra_rdoc_files = %w(README.rdoc CHANGELOG.md)
|
29
29
|
end
|
30
|
-
|
metadata
CHANGED
@@ -1,190 +1,214 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: youtube_it
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 2.4.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.4.1
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
8
|
-
|
9
|
-
|
6
|
+
authors:
|
7
|
+
- kylejginavan
|
8
|
+
- chebyte
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
12
|
+
date: 2014-07-12 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: nokogiri
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ~>
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 1.6.0
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 1.6.0
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: oauth
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ~>
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 0.4.4
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ~>
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 0.4.4
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: oauth2
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ~>
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 1.0.0
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 1.0.0
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: simple_oauth
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 0.1.5
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 0.1.5
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: faraday
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0.8'
|
77
|
+
- - <
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0.10'
|
80
|
+
type: :runtime
|
81
|
+
prerelease: false
|
82
|
+
version_requirements: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0.8'
|
87
|
+
- - <
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.10'
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: builder
|
92
|
+
requirement: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
type: :runtime
|
98
|
+
prerelease: false
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
name: excon
|
106
|
+
requirement: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
type: :runtime
|
112
|
+
prerelease: false
|
113
|
+
version_requirements: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
- !ruby/object:Gem::Dependency
|
119
|
+
name: json
|
120
|
+
requirement: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '1.8'
|
125
|
+
type: :runtime
|
126
|
+
prerelease: false
|
127
|
+
version_requirements: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ~>
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '1.8'
|
132
|
+
- !ruby/object:Gem::Dependency
|
133
|
+
name: webmock
|
134
|
+
requirement: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
type: :development
|
140
|
+
prerelease: false
|
141
|
+
version_requirements: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
115
146
|
description: Upload, delete, update, comment on youtube videos all from one gem.
|
116
|
-
email:
|
117
|
-
|
118
|
-
|
147
|
+
email:
|
148
|
+
- kylejginavan@gmail.com
|
149
|
+
- maurotorres@gmail.com
|
119
150
|
executables: []
|
120
|
-
|
121
151
|
extensions: []
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
- CHANGELOG.md
|
152
|
+
extra_rdoc_files:
|
153
|
+
- README.rdoc
|
154
|
+
- CHANGELOG.md
|
155
|
+
files:
|
156
|
+
- lib/youtube_it/chain_io.rb
|
157
|
+
- lib/youtube_it/client.rb
|
158
|
+
- lib/youtube_it/middleware/faraday_authheader.rb
|
159
|
+
- lib/youtube_it/middleware/faraday_oauth.rb
|
160
|
+
- lib/youtube_it/middleware/faraday_oauth2.rb
|
161
|
+
- lib/youtube_it/middleware/faraday_youtubeit.rb
|
162
|
+
- lib/youtube_it/model/activity.rb
|
163
|
+
- lib/youtube_it/model/author.rb
|
164
|
+
- lib/youtube_it/model/caption.rb
|
165
|
+
- lib/youtube_it/model/category.rb
|
166
|
+
- lib/youtube_it/model/comment.rb
|
167
|
+
- lib/youtube_it/model/contact.rb
|
168
|
+
- lib/youtube_it/model/content.rb
|
169
|
+
- lib/youtube_it/model/message.rb
|
170
|
+
- lib/youtube_it/model/playlist.rb
|
171
|
+
- lib/youtube_it/model/rating.rb
|
172
|
+
- lib/youtube_it/model/subscription.rb
|
173
|
+
- lib/youtube_it/model/thumbnail.rb
|
174
|
+
- lib/youtube_it/model/user.rb
|
175
|
+
- lib/youtube_it/model/video.rb
|
176
|
+
- lib/youtube_it/parser.rb
|
177
|
+
- lib/youtube_it/record.rb
|
178
|
+
- lib/youtube_it/request/base_search.rb
|
179
|
+
- lib/youtube_it/request/error.rb
|
180
|
+
- lib/youtube_it/request/remote_file.rb
|
181
|
+
- lib/youtube_it/request/standard_search.rb
|
182
|
+
- lib/youtube_it/request/user_search.rb
|
183
|
+
- lib/youtube_it/request/video_search.rb
|
184
|
+
- lib/youtube_it/request/video_upload.rb
|
185
|
+
- lib/youtube_it/response/video_search.rb
|
186
|
+
- lib/youtube_it/version.rb
|
187
|
+
- lib/youtube_it.rb
|
188
|
+
- README.rdoc
|
189
|
+
- youtube_it.gemspec
|
190
|
+
- CHANGELOG.md
|
162
191
|
homepage: http://github.com/kylejginavan/youtube_it
|
163
192
|
licenses: []
|
164
|
-
|
193
|
+
metadata: {}
|
165
194
|
post_install_message:
|
166
195
|
rdoc_options: []
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
- - ">="
|
180
|
-
- !ruby/object:Gem::Version
|
181
|
-
version: "0"
|
196
|
+
require_paths:
|
197
|
+
- lib
|
198
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
199
|
+
requirements:
|
200
|
+
- - '>='
|
201
|
+
- !ruby/object:Gem::Version
|
202
|
+
version: '0'
|
203
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - '>='
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: '0'
|
182
208
|
requirements: []
|
183
|
-
|
184
209
|
rubyforge_project:
|
185
|
-
rubygems_version:
|
210
|
+
rubygems_version: 2.0.14
|
186
211
|
signing_key:
|
187
|
-
specification_version:
|
212
|
+
specification_version: 4
|
188
213
|
summary: The most complete Ruby wrapper for youtube api's
|
189
214
|
test_files: []
|
190
|
-
|