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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b60bee886ed9551a6b9590fa99ad1146472dc90d332a50854a0d7ba490b40f93
4
- data.tar.gz: 72e08ae6b64e508e873a1d47f00c71e021d994bfb3bb65b2c1b52e4e6709950a
3
+ metadata.gz: 3d1e942d9a105cfd41c9fcce6295f2ff433a8ab432e2d7e6084e0e8f9627f6ee
4
+ data.tar.gz: 8f73301f471b3a9d0ae55ef0ef5389551d8d67000b7a1a4fa305ecb7a1686743
5
5
  SHA512:
6
- metadata.gz: 87f08494b156a1846e63eff41c154cbfc462e1a65c1391bdc530ae1a84ef891150b72b0e604359a2d20d45a5fd0db88a7429c38ffa80b3a2f721b25452ebd119
7
- data.tar.gz: 0453b6e46b53d2c3b2c0ffcdccd0daba325c97f96ebfacb37939172e6137c271236f94ef2fc05d25a6df3b8784c84040ab4b71064ea861b10e90e201a3198128
6
+ metadata.gz: b9289ffa8d210d2c79753a75273e4a8ba6224a66e2df9806cc82103d20958687b691c4410a2b4da6ec77267eb22459362219fcf744d44dda47c32fa19891c5a6
7
+ data.tar.gz: e561898b7f286c9bba3d81d1e4ffb1bd1e595647127d04e0d586917af39a5c1e7f65572a354fb45244d354f3184f07a2fb52c9f24604a53ee3b5ea3106a29c91
@@ -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
- {Wed, 8 May 2014 => 12.4, Thu, 9 May 2014 => 3.2, Fri, 10 May 2014 => …}
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
- {total: 3450}
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] || 'BPNYv0vd78A'
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.annotations.first.text
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}"
@@ -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>] :title The video’s tags.
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 = {})
@@ -17,7 +17,7 @@ module Yt
17
17
 
18
18
  def update(attributes = {})
19
19
  underscore_keys! attributes
20
- do_patch body: attributes
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
- do_patch body: attributes.slice(:policy_id)
16
+ do_update body: attributes.slice(:policy_id)
17
17
  true
18
18
  end
19
19
 
20
20
  private
21
21
 
22
- # @return [Hash] the parameters to submit to YouTube to patch an asset
23
- # match policy.
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
@@ -392,7 +392,7 @@ module Yt
392
392
 
393
393
  has_many :resumable_sessions
394
394
 
395
- # @!attribute [r] channel
395
+ # @!attribute [r] claim
396
396
  # @return [Yt::Models::Claim, nil] the first claim on the video by
397
397
  # the content owner of the video, if eagerly loaded.
398
398
  def claim
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.32.4'
2
+ VERSION = '0.32.5'
3
3
  end
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
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-06-28 00:00:00.000000000 Z
11
+ date: 2019-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport