yt 0.33.3 → 0.33.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/yt/models/account.rb +13 -3
- data/lib/yt/models/channel.rb +19 -0
- data/lib/yt/models/status.rb +3 -1
- data/lib/yt/models/video.rb +16 -1
- data/lib/yt/request.rb +1 -2
- data/lib/yt/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c89bfab3bb32975237aa1b79a1f0897a240ea494f3d3928a03b423c734b71f6
|
4
|
+
data.tar.gz: 6c58ab20408d9fdf79265fc499d1ee0f88623295de50592a25948e8029aaf91a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bcd96aa69c14456e067f0cad222148743334e8d8f89f3a052923f687e2d06e3a53db772898ec43399d1cdff20352fc9e56f63745bdbbebe69641511255cf5a9
|
7
|
+
data.tar.gz: 52245373b815ad681f7516bea9157597c7b5b118db206a50c7ca2746cf61b8c591f2fb4765c63787427cac26fb803ce11053c1d12855e4d213fdbfb54b372e0c
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ For more information about changelogs, check
|
|
6
6
|
[Keep a Changelog](http://keepachangelog.com) and
|
7
7
|
[Vandamme](http://tech-angels.github.io/vandamme).
|
8
8
|
|
9
|
+
## 0.33.4 - 2021-01-15
|
10
|
+
|
11
|
+
* [REMOVAL] remove retry for quota errors
|
12
|
+
|
9
13
|
## 0.33.3 - 2020-11-17
|
10
14
|
|
11
15
|
* [BUGFIX] require the `URL` model when requiring `yt`
|
data/lib/yt/models/account.rb
CHANGED
@@ -67,13 +67,19 @@ module Yt
|
|
67
67
|
# @option params [String] :description The video’s description.
|
68
68
|
# @option params [Array<String>] :tags The video’s tags.
|
69
69
|
# @option params [String] :privacy_status The video’s privacy status.
|
70
|
+
# @option params [Boolean] :self_declared_made_for_kids The video’s made for kids self-declaration.
|
70
71
|
# @return [Yt::Models::Video] the newly uploaded video.
|
71
72
|
def upload_video(path_or_url, params = {})
|
72
73
|
file = open path_or_url, 'rb'
|
73
74
|
session = resumable_sessions.insert file.size, upload_body(params)
|
74
75
|
|
75
76
|
session.update(body: file) do |data|
|
76
|
-
Yt::Video.new
|
77
|
+
Yt::Video.new(
|
78
|
+
id: data['id'],
|
79
|
+
snippet: data['snippet'],
|
80
|
+
status: data['status'],
|
81
|
+
auth: self
|
82
|
+
)
|
77
83
|
end
|
78
84
|
end
|
79
85
|
|
@@ -217,8 +223,12 @@ module Yt
|
|
217
223
|
snippet[:categoryId] = snippet.delete(:category_id) if snippet[:category_id]
|
218
224
|
body[:snippet] = snippet if snippet.any?
|
219
225
|
|
220
|
-
|
221
|
-
|
226
|
+
privacy_status = params[:privacy_status]
|
227
|
+
self_declared_made_for_kids = params[:self_declared_made_for_kids]
|
228
|
+
|
229
|
+
body[:status] = {}
|
230
|
+
body[:status][:privacyStatus] = privacy_status if privacy_status
|
231
|
+
body[:status][:selfDeclaredMadeForKids] = self_declared_made_for_kids unless self_declared_made_for_kids.nil?
|
222
232
|
end
|
223
233
|
end
|
224
234
|
|
data/lib/yt/models/channel.rb
CHANGED
@@ -29,6 +29,25 @@ module Yt
|
|
29
29
|
# @return [Time] the date and time that the channel was created.
|
30
30
|
delegate :published_at, to: :snippet
|
31
31
|
|
32
|
+
### STATUS ###
|
33
|
+
|
34
|
+
# @!attribute [r] made_for_kids?
|
35
|
+
# @return [Boolean, nil] This value indicates whether the channel is
|
36
|
+
# designated as child-directed, and it contains the current "made for
|
37
|
+
# kids" status of the channel.
|
38
|
+
def made_for_kids?
|
39
|
+
status.made_for_kids
|
40
|
+
end
|
41
|
+
|
42
|
+
# @!attribute [r] self_declared_made_for_kids?
|
43
|
+
# @return [Boolean, nil] In a channels.update request, this property
|
44
|
+
# allows the channel owner to designate the channel as
|
45
|
+
# child-directed. The property value is only returned if the channel
|
46
|
+
# owner authorized the API request.
|
47
|
+
def self_declared_made_for_kids?
|
48
|
+
status.self_declared_made_for_kids
|
49
|
+
end
|
50
|
+
|
32
51
|
### SUBSCRIPTION ###
|
33
52
|
|
34
53
|
has_one :subscription
|
data/lib/yt/models/status.rb
CHANGED
data/lib/yt/models/video.rb
CHANGED
@@ -223,6 +223,21 @@ module Yt
|
|
223
223
|
status.embeddable
|
224
224
|
end
|
225
225
|
|
226
|
+
# @return [Boolean, nil] This value indicates whether the video is
|
227
|
+
# designated as child-directed, and it contains the current "made for
|
228
|
+
# kids" status of the video.
|
229
|
+
def made_for_kids?
|
230
|
+
status.made_for_kids
|
231
|
+
end
|
232
|
+
|
233
|
+
# @return [Boolean, nil] In a videos.insert or videos.update request,
|
234
|
+
# this property allows the channel owner to designate the video as
|
235
|
+
# being child-directed. In a videos.list request, the property value
|
236
|
+
# is only returned if the channel owner authorized the API request.
|
237
|
+
def self_declared_made_for_kids?
|
238
|
+
status.self_declared_made_for_kids
|
239
|
+
end
|
240
|
+
|
226
241
|
### CONTENT DETAILS ###
|
227
242
|
|
228
243
|
has_one :content_detail
|
@@ -667,7 +682,7 @@ module Yt
|
|
667
682
|
snippet_keys = [:title, :description, :tags, :category_id]
|
668
683
|
snippet = {keys: snippet_keys, sanitize_brackets: true}
|
669
684
|
status_keys = [:privacy_status, :embeddable, :license,
|
670
|
-
:public_stats_viewable, :publish_at]
|
685
|
+
:public_stats_viewable, :publish_at, :self_declared_made_for_kids]
|
671
686
|
{snippet: snippet, status: {keys: status_keys}}
|
672
687
|
end
|
673
688
|
|
data/lib/yt/request.rb
CHANGED
@@ -197,8 +197,7 @@ module Yt
|
|
197
197
|
# for a couple of seconds might solve the connection issues.
|
198
198
|
def run_again?
|
199
199
|
refresh_token_and_retry? && sleep_and_retry?(1) ||
|
200
|
-
server_error? && sleep_and_retry?(3)
|
201
|
-
exceeded_quota? && sleep_and_retry?(3)
|
200
|
+
server_error? && sleep_and_retry?(3)
|
202
201
|
end
|
203
202
|
|
204
203
|
# Returns the list of server errors worth retrying the request once.
|
data/lib/yt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.33.
|
4
|
+
version: 0.33.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claudio Baccigalupo
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -279,7 +279,7 @@ homepage: http://github.com/Fullscreen/yt
|
|
279
279
|
licenses:
|
280
280
|
- MIT
|
281
281
|
metadata: {}
|
282
|
-
post_install_message:
|
282
|
+
post_install_message:
|
283
283
|
rdoc_options: []
|
284
284
|
require_paths:
|
285
285
|
- lib
|
@@ -294,8 +294,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
294
294
|
- !ruby/object:Gem::Version
|
295
295
|
version: '0'
|
296
296
|
requirements: []
|
297
|
-
rubygems_version: 3.1.
|
298
|
-
signing_key:
|
297
|
+
rubygems_version: 3.1.2
|
298
|
+
signing_key:
|
299
299
|
specification_version: 4
|
300
300
|
summary: Yt makes it easy to interact with Youtube V3 API by providing a modular,
|
301
301
|
intuitive and tested Ruby-style API.
|