yt 0.32.4 → 0.32.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -2
- data/bin/yt +2 -9
- data/lib/yt/models/account.rb +1 -1
- data/lib/yt/models/asset.rb +10 -1
- data/lib/yt/models/match_policy.rb +4 -6
- data/lib/yt/models/video.rb +1 -1
- data/lib/yt/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d1e942d9a105cfd41c9fcce6295f2ff433a8ab432e2d7e6084e0e8f9627f6ee
|
4
|
+
data.tar.gz: 8f73301f471b3a9d0ae55ef0ef5389551d8d67000b7a1a4fa305ecb7a1686743
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9289ffa8d210d2c79753a75273e4a8ba6224a66e2df9806cc82103d20958687b691c4410a2b4da6ec77267eb22459362219fcf744d44dda47c32fa19891c5a6
|
7
|
+
data.tar.gz: e561898b7f286c9bba3d81d1e4ffb1bd1e595647127d04e0d586917af39a5c1e7f65572a354fb45244d354f3184f07a2fb52c9f24604a53ee3b5ea3106a29c91
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,12 @@ 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
|
+
|
10
|
+
## 0.32.5 - 2019-11-06
|
11
|
+
|
12
|
+
* [BUGFIX] Fix `MatchPolicy#update` and `Asset#update` by using `PUT` instead of `PATCH`
|
13
|
+
* Update `bin/yt` file to keep `yt info` command work
|
14
|
+
|
9
15
|
## 0.32.4 - 2019-06-26
|
10
16
|
|
11
17
|
* [FEATURE] Add `ownership_effective` method to access asset ownership ("effective") via the asset object.
|
@@ -457,11 +463,11 @@ If your code expects reports to return results **by day** then you **must** add
|
|
457
463
|
the `by: :day` option to your report method. The new default is `by: :range`.
|
458
464
|
For instance `channel.views` would return
|
459
465
|
|
460
|
-
|
466
|
+
{Wed, 8 May 2014 => 12.4, Thu, 9 May 2014 => 3.2, Fri, 10 May 2014 => …}
|
461
467
|
|
462
468
|
and now returns the same as calling `channel.views by: :range`:
|
463
469
|
|
464
|
-
|
470
|
+
{total: 3450}
|
465
471
|
|
466
472
|
Additionally, if you expect reports **by day** then you **must** specify the
|
467
473
|
`:since` option to your report method. Previously, this value was set to
|
data/bin/yt
CHANGED
@@ -8,20 +8,13 @@ rescue LoadError
|
|
8
8
|
end
|
9
9
|
|
10
10
|
Yt.configuration.log_level = :debug
|
11
|
-
id = ARGV[1] || '
|
11
|
+
id = ARGV[1] || 'rdwz7QiG0lk'
|
12
12
|
|
13
13
|
case ARGV[0]
|
14
14
|
when 'info'
|
15
15
|
puts "Yt version #{Yt::VERSION}"
|
16
16
|
video = Yt::Video.new id: id
|
17
|
-
puts video.
|
18
|
-
when 'annotations'
|
19
|
-
video = Yt::Video.new id: id
|
20
|
-
count = video.annotations.size
|
21
|
-
puts "Video #{id} has #{count} #{'annotation'.pluralize count}"
|
22
|
-
video.annotations.each.with_index do |annotation, i|
|
23
|
-
puts "#{i+1}) #{annotation.text}"
|
24
|
-
end
|
17
|
+
puts video.title
|
25
18
|
when 'video'
|
26
19
|
video = Yt::Video.new id: id
|
27
20
|
views = "#{video.view_count} #{'view'.pluralize video.view_count}"
|
data/lib/yt/models/account.rb
CHANGED
@@ -65,7 +65,7 @@ module Yt
|
|
65
65
|
# @param [Hash] params the metadata to add to the uploaded video.
|
66
66
|
# @option params [String] :title The video’s title.
|
67
67
|
# @option params [String] :description The video’s description.
|
68
|
-
# @option params [Array<String>] :
|
68
|
+
# @option params [Array<String>] :tags The video’s tags.
|
69
69
|
# @option params [String] :privacy_status The video’s privacy status.
|
70
70
|
# @return [Yt::Models::Video] the newly uploaded video.
|
71
71
|
def upload_video(path_or_url, params = {})
|
data/lib/yt/models/asset.rb
CHANGED
@@ -17,7 +17,7 @@ module Yt
|
|
17
17
|
|
18
18
|
def update(attributes = {})
|
19
19
|
underscore_keys! attributes
|
20
|
-
|
20
|
+
do_update body: attributes
|
21
21
|
true
|
22
22
|
end
|
23
23
|
|
@@ -112,6 +112,15 @@ module Yt
|
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
+
# @see https://developers.google.com/youtube/partner/docs/v1/assets/update
|
116
|
+
def update_params
|
117
|
+
super.tap do |params|
|
118
|
+
params[:expected_response] = Net::HTTPOK
|
119
|
+
params[:path] = "/youtube/partner/v1/assets/#{@id}"
|
120
|
+
params[:params] = {on_behalf_of_content_owner: @auth.owner_name}
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
115
124
|
# @return [Hash] the parameters to submit to YouTube to get an asset.
|
116
125
|
# @see https://developers.google.com/youtube/partner/docs/v1/assets/get
|
117
126
|
def get_params
|
@@ -13,16 +13,14 @@ module Yt
|
|
13
13
|
|
14
14
|
def update(attributes = {})
|
15
15
|
underscore_keys! attributes
|
16
|
-
|
16
|
+
do_update body: attributes.slice(:policy_id)
|
17
17
|
true
|
18
18
|
end
|
19
19
|
|
20
20
|
private
|
21
21
|
|
22
|
-
# @
|
23
|
-
|
24
|
-
# @see https://developers.google.com/youtube/partner/docs/v1/assetMatchPolicy/patch
|
25
|
-
def patch_params
|
22
|
+
# @see https://developers.google.com/youtube/partner/docs/v1/assetMatchPolicy/update
|
23
|
+
def update_params
|
26
24
|
super.tap do |params|
|
27
25
|
params[:path] = "/youtube/partner/v1/assets/#{@asset_id}/matchPolicy"
|
28
26
|
params[:params] = {on_behalf_of_content_owner: @auth.owner_name}
|
@@ -31,4 +29,4 @@ module Yt
|
|
31
29
|
end
|
32
30
|
end
|
33
31
|
end
|
34
|
-
end
|
32
|
+
end
|
data/lib/yt/models/video.rb
CHANGED
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.32.
|
4
|
+
version: 0.32.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claudio Baccigalupo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|