yt 0.25.40 → 0.26.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/yt/models/channel.rb +0 -6
- data/lib/yt/models/video.rb +0 -6
- data/lib/yt/models/video_group.rb +0 -6
- data/lib/yt/version.rb +1 -1
- data/spec/requests/as_account/channel_spec.rb +0 -4
- data/spec/requests/as_account/video_spec.rb +2100 -4
- data/spec/requests/as_content_owner/channel_spec.rb +4 -157
- data/spec/requests/as_content_owner/video_group_spec.rb +2 -2
- data/spec/requests/as_content_owner/video_spec.rb +5 -72
- metadata +2 -2
@@ -14,9 +14,9 @@ describe Yt::Channel, :partner do
|
|
14
14
|
metrics = {views: Integer, uniques: Integer,
|
15
15
|
estimated_minutes_watched: Integer, comments: Integer, likes: Integer,
|
16
16
|
dislikes: Integer, shares: Integer, subscribers_gained: Integer,
|
17
|
-
subscribers_lost: Integer,
|
17
|
+
subscribers_lost: Integer,
|
18
18
|
videos_added_to_playlists: Integer, videos_removed_from_playlists: Integer,
|
19
|
-
|
19
|
+
average_view_duration: Integer,
|
20
20
|
average_view_percentage: Float, annotation_clicks: Integer,
|
21
21
|
annotation_click_through_rate: Float,
|
22
22
|
annotation_close_rate: Float, earnings: Float, impressions: Integer,
|
@@ -58,9 +58,9 @@ describe Yt::Channel, :partner do
|
|
58
58
|
end
|
59
59
|
|
60
60
|
[:views, :uniques, :comments, :likes, :dislikes, :shares,
|
61
|
-
:subscribers_gained, :subscribers_lost,
|
61
|
+
:subscribers_gained, :subscribers_lost,
|
62
62
|
:videos_added_to_playlists, :videos_removed_from_playlists,
|
63
|
-
:
|
63
|
+
:estimated_minutes_watched, :average_view_duration,
|
64
64
|
:average_view_percentage, :impressions, :monetized_playbacks,
|
65
65
|
:annotation_clicks, :annotation_click_through_rate, :playback_based_cpm,
|
66
66
|
:annotation_close_rate, :earnings].each do |metric|
|
@@ -118,7 +118,6 @@ describe Yt::Channel, :partner do
|
|
118
118
|
subscribers_gained: Integer, subscribers_lost: Integer,
|
119
119
|
estimated_minutes_watched: Integer, average_view_duration: Integer,
|
120
120
|
annotation_clicks: Integer, annotation_click_through_rate: Float,
|
121
|
-
favorites_added: Integer, favorites_removed: Integer,
|
122
121
|
videos_added_to_playlists: Integer, videos_removed_from_playlists: Integer,
|
123
122
|
average_view_percentage: Float, impressions: Integer,
|
124
123
|
shares: Integer, playback_based_cpm: Float,
|
@@ -876,116 +875,6 @@ describe Yt::Channel, :partner do
|
|
876
875
|
end
|
877
876
|
end
|
878
877
|
|
879
|
-
describe 'favorites added can be retrieved for a single country' do
|
880
|
-
let(:country_code) { 'US' }
|
881
|
-
let(:favorites_added) { channel.favorites_added since: date, by: by, in: location }
|
882
|
-
let(:date) { ENV['YT_TEST_PARTNER_VIDEO_DATE'] }
|
883
|
-
|
884
|
-
context 'and grouped by day' do
|
885
|
-
let(:by) { :day }
|
886
|
-
|
887
|
-
context 'with the :in option set to the country code' do
|
888
|
-
let(:location) { country_code }
|
889
|
-
it { expect(favorites_added.keys.min).to eq date.to_date }
|
890
|
-
end
|
891
|
-
|
892
|
-
context 'with the :in option set to {country: country code}' do
|
893
|
-
let(:location) { {country: country_code} }
|
894
|
-
it { expect(favorites_added.keys.min).to eq date.to_date }
|
895
|
-
end
|
896
|
-
end
|
897
|
-
|
898
|
-
context 'and grouped by country' do
|
899
|
-
let(:by) { :country }
|
900
|
-
|
901
|
-
context 'with the :in option set to the country code' do
|
902
|
-
let(:location) { country_code }
|
903
|
-
it { expect(favorites_added.keys).to eq [country_code] }
|
904
|
-
end
|
905
|
-
|
906
|
-
context 'with the :in option set to {country: country code}' do
|
907
|
-
let(:location) { {country: country_code} }
|
908
|
-
it { expect(favorites_added.keys).to eq [country_code] }
|
909
|
-
end
|
910
|
-
end
|
911
|
-
end
|
912
|
-
|
913
|
-
describe 'added favorites can be grouped by day' do
|
914
|
-
let(:range) { {since: 4.days.ago.to_date, until: 3.days.ago.to_date} }
|
915
|
-
let(:keys) { range.values }
|
916
|
-
|
917
|
-
specify 'with the :by option set to :day' do
|
918
|
-
favorites_added = channel.favorites_added range.merge by: :day
|
919
|
-
expect(favorites_added.keys).to eq range.values
|
920
|
-
end
|
921
|
-
end
|
922
|
-
|
923
|
-
describe 'added favorites can be grouped by country' do
|
924
|
-
let(:range) { {since: 4.days.ago, until: 3.days.ago} }
|
925
|
-
|
926
|
-
specify 'with the :by option set to :country' do
|
927
|
-
favorites_added = channel.favorites_added range.merge by: :country
|
928
|
-
expect(favorites_added.keys).to all(be_a String)
|
929
|
-
expect(favorites_added.keys.map(&:length).uniq).to eq [2]
|
930
|
-
expect(favorites_added.values).to all(be_an Integer)
|
931
|
-
end
|
932
|
-
end
|
933
|
-
|
934
|
-
describe 'favorites removed can be retrieved for a single country' do
|
935
|
-
let(:country_code) { 'US' }
|
936
|
-
let(:favorites_removed) { channel.favorites_removed since: date, by: by, in: location }
|
937
|
-
let(:date) { ENV['YT_TEST_PARTNER_VIDEO_DATE'] }
|
938
|
-
|
939
|
-
context 'and grouped by day' do
|
940
|
-
let(:by) { :day }
|
941
|
-
|
942
|
-
context 'with the :in option set to the country code' do
|
943
|
-
let(:location) { country_code }
|
944
|
-
it { expect(favorites_removed.keys.min).to eq date.to_date }
|
945
|
-
end
|
946
|
-
|
947
|
-
context 'with the :in option set to {country: country code}' do
|
948
|
-
let(:location) { {country: country_code} }
|
949
|
-
it { expect(favorites_removed.keys.min).to eq date.to_date }
|
950
|
-
end
|
951
|
-
end
|
952
|
-
|
953
|
-
context 'and grouped by country' do
|
954
|
-
let(:by) { :country }
|
955
|
-
|
956
|
-
context 'with the :in option set to the country code' do
|
957
|
-
let(:location) { country_code }
|
958
|
-
it { expect(favorites_removed.keys).to eq [country_code] }
|
959
|
-
end
|
960
|
-
|
961
|
-
context 'with the :in option set to {country: country code}' do
|
962
|
-
let(:location) { {country: country_code} }
|
963
|
-
it { expect(favorites_removed.keys).to eq [country_code] }
|
964
|
-
end
|
965
|
-
end
|
966
|
-
end
|
967
|
-
|
968
|
-
describe 'removed favorites can be grouped by day' do
|
969
|
-
let(:range) { {since: 4.days.ago.to_date, until: 3.days.ago.to_date} }
|
970
|
-
let(:keys) { range.values }
|
971
|
-
|
972
|
-
specify 'with the :by option set to :day' do
|
973
|
-
favorites_removed = channel.favorites_removed range.merge by: :day
|
974
|
-
expect(favorites_removed.keys).to eq range.values
|
975
|
-
end
|
976
|
-
end
|
977
|
-
|
978
|
-
describe 'removed favorites can be grouped by country' do
|
979
|
-
let(:range) { {since: ENV['YT_TEST_PARTNER_VIDEO_DATE'], until: Date.parse(ENV['YT_TEST_PARTNER_VIDEO_DATE']) + 5} }
|
980
|
-
|
981
|
-
specify 'with the :by option set to :country' do
|
982
|
-
favorites_removed = channel.favorites_removed range.merge by: :country
|
983
|
-
expect(favorites_removed.keys).to all(be_a String)
|
984
|
-
expect(favorites_removed.keys.map(&:length).uniq).to eq [2]
|
985
|
-
expect(favorites_removed.values).to all(be_an Integer)
|
986
|
-
end
|
987
|
-
end
|
988
|
-
|
989
878
|
describe 'videos added to playlists can be retrieved for a single country' do
|
990
879
|
let(:country_code) { 'US' }
|
991
880
|
let(:videos_added_to_playlists) { channel.videos_added_to_playlists since: date, by: by, in: location }
|
@@ -1020,27 +909,6 @@ describe Yt::Channel, :partner do
|
|
1020
909
|
end
|
1021
910
|
end
|
1022
911
|
|
1023
|
-
describe 'added favorites can be grouped by day' do
|
1024
|
-
let(:range) { {since: 4.days.ago.to_date, until: 3.days.ago.to_date} }
|
1025
|
-
let(:keys) { range.values }
|
1026
|
-
|
1027
|
-
specify 'with the :by option set to :day' do
|
1028
|
-
videos_added_to_playlists = channel.videos_added_to_playlists range.merge by: :day
|
1029
|
-
expect(videos_added_to_playlists.keys).to eq range.values
|
1030
|
-
end
|
1031
|
-
end
|
1032
|
-
|
1033
|
-
describe 'added favorites can be grouped by country' do
|
1034
|
-
let(:range) { {since: 4.days.ago, until: 3.days.ago} }
|
1035
|
-
|
1036
|
-
specify 'with the :by option set to :country' do
|
1037
|
-
videos_added_to_playlists = channel.videos_added_to_playlists range.merge by: :country
|
1038
|
-
expect(videos_added_to_playlists.keys).to all(be_a String)
|
1039
|
-
expect(videos_added_to_playlists.keys.map(&:length).uniq).to eq [2]
|
1040
|
-
expect(videos_added_to_playlists.values).to all(be_an Integer)
|
1041
|
-
end
|
1042
|
-
end
|
1043
|
-
|
1044
912
|
describe 'videos removed from playlists can be retrieved for a single country' do
|
1045
913
|
let(:country_code) { 'US' }
|
1046
914
|
let(:videos_removed_from_playlists) { channel.videos_removed_from_playlists since: date, by: by, in: location }
|
@@ -1075,27 +943,6 @@ describe Yt::Channel, :partner do
|
|
1075
943
|
end
|
1076
944
|
end
|
1077
945
|
|
1078
|
-
describe 'removed favorites can be grouped by day' do
|
1079
|
-
let(:range) { {since: 4.days.ago.to_date, until: 3.days.ago.to_date} }
|
1080
|
-
let(:keys) { range.values }
|
1081
|
-
|
1082
|
-
specify 'with the :by option set to :day' do
|
1083
|
-
videos_removed_from_playlists = channel.videos_removed_from_playlists range.merge by: :day
|
1084
|
-
expect(videos_removed_from_playlists.keys).to eq range.values
|
1085
|
-
end
|
1086
|
-
end
|
1087
|
-
|
1088
|
-
describe 'removed favorites can be grouped by country' do
|
1089
|
-
let(:range) { {since: ENV['YT_TEST_PARTNER_VIDEO_DATE'], until: Date.parse(ENV['YT_TEST_PARTNER_VIDEO_DATE']) + 5} }
|
1090
|
-
|
1091
|
-
specify 'with the :by option set to :country' do
|
1092
|
-
videos_removed_from_playlists = channel.videos_removed_from_playlists range.merge by: :country
|
1093
|
-
expect(videos_removed_from_playlists.keys).to all(be_a String)
|
1094
|
-
expect(videos_removed_from_playlists.keys.map(&:length).uniq).to eq [2]
|
1095
|
-
expect(videos_removed_from_playlists.values).to all(be_an Integer)
|
1096
|
-
end
|
1097
|
-
end
|
1098
|
-
|
1099
946
|
describe 'estimated minutes watched can be retrieved for a single country' do
|
1100
947
|
let(:country_code) { 'US' }
|
1101
948
|
let(:estimated_minutes_watched) { channel.estimated_minutes_watched since: date, by: by, in: location }
|
@@ -55,9 +55,9 @@ describe Yt::VideoGroup, :partner do
|
|
55
55
|
metrics = {views: Integer, uniques: Integer,
|
56
56
|
estimated_minutes_watched: Integer, comments: Integer, likes: Integer,
|
57
57
|
dislikes: Integer, shares: Integer, subscribers_gained: Integer,
|
58
|
-
subscribers_lost: Integer,
|
58
|
+
subscribers_lost: Integer,
|
59
59
|
videos_added_to_playlists: Integer, videos_removed_from_playlists: Integer,
|
60
|
-
|
60
|
+
average_view_duration: Integer,
|
61
61
|
average_view_percentage: Float, annotation_clicks: Integer,
|
62
62
|
annotation_click_through_rate: Float,
|
63
63
|
annotation_close_rate: Float, earnings: Float, impressions: Integer,
|
@@ -14,9 +14,9 @@ describe Yt::Video, :partner do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
[:views, :uniques, :comments, :likes, :dislikes, :shares,
|
17
|
-
:subscribers_gained, :subscribers_lost,
|
17
|
+
:subscribers_gained, :subscribers_lost,
|
18
18
|
:videos_added_to_playlists, :videos_removed_from_playlists,
|
19
|
-
:
|
19
|
+
:estimated_minutes_watched, :average_view_duration,
|
20
20
|
:average_view_percentage, :impressions, :monetized_playbacks,
|
21
21
|
:annotation_clicks, :annotation_click_through_rate, :playback_based_cpm,
|
22
22
|
:annotation_close_rate, :earnings].each do |metric|
|
@@ -111,7 +111,6 @@ describe Yt::Video, :partner do
|
|
111
111
|
|
112
112
|
{views: Integer, comments: Integer, likes: Integer, dislikes: Integer,
|
113
113
|
shares: Integer, subscribers_gained: Integer, subscribers_lost: Integer,
|
114
|
-
favorites_added: Integer,
|
115
114
|
videos_added_to_playlists: Integer, videos_removed_from_playlists: Integer,
|
116
115
|
estimated_minutes_watched: Integer, average_view_duration: Integer,
|
117
116
|
average_view_percentage: Float, impressions: Integer,
|
@@ -139,31 +138,8 @@ describe Yt::Video, :partner do
|
|
139
138
|
end
|
140
139
|
end
|
141
140
|
|
142
|
-
{favorites_removed: Integer}.each do |metric, type|
|
143
|
-
describe "#{metric} can be grouped by range" do
|
144
|
-
let(:id) { 'NeMlqbX2Ifg' }
|
145
|
-
let(:metric) { metric }
|
146
|
-
|
147
|
-
context 'without a :by option (default)' do
|
148
|
-
let(:result) { video.public_send metric }
|
149
|
-
specify do
|
150
|
-
expect(result.size).to be 1
|
151
|
-
expect(result[:total]).to be_a type
|
152
|
-
end
|
153
|
-
end
|
154
|
-
|
155
|
-
context 'with the :by option set to :range' do
|
156
|
-
let(:result) { video.public_send metric, by: :range }
|
157
|
-
specify do
|
158
|
-
expect(result.size).to be 1
|
159
|
-
expect(result[:total]).to be_a type
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
141
|
[:views, :comments, :likes, :dislikes, :shares,
|
166
|
-
:subscribers_gained, :subscribers_lost,
|
142
|
+
:subscribers_gained, :subscribers_lost,
|
167
143
|
:videos_added_to_playlists, :videos_removed_from_playlists,
|
168
144
|
:estimated_minutes_watched, :average_view_duration,
|
169
145
|
:average_view_percentage, :impressions, :monetized_playbacks,
|
@@ -213,9 +189,9 @@ describe Yt::Video, :partner do
|
|
213
189
|
metrics = {views: Integer, uniques: Integer,
|
214
190
|
estimated_minutes_watched: Integer, comments: Integer, likes: Integer,
|
215
191
|
dislikes: Integer, shares: Integer, subscribers_gained: Integer,
|
216
|
-
subscribers_lost: Integer,
|
192
|
+
subscribers_lost: Integer,
|
217
193
|
videos_added_to_playlists: Integer, videos_removed_from_playlists: Integer,
|
218
|
-
|
194
|
+
average_view_duration: Integer,
|
219
195
|
average_view_percentage: Float, annotation_clicks: Integer,
|
220
196
|
annotation_click_through_rate: Float,
|
221
197
|
annotation_close_rate: Float, earnings: Float, impressions: Integer,
|
@@ -632,49 +608,6 @@ describe Yt::Video, :partner do
|
|
632
608
|
end
|
633
609
|
end
|
634
610
|
|
635
|
-
describe 'added favorites can be grouped by day' do
|
636
|
-
let(:range) { {since: 4.days.ago.to_date, until: 3.days.ago.to_date} }
|
637
|
-
let(:keys) { range.values }
|
638
|
-
|
639
|
-
specify 'with the :by option set to :day' do
|
640
|
-
favorites_added = video.favorites_added range.merge by: :day
|
641
|
-
expect(favorites_added.keys).to eq range.values
|
642
|
-
end
|
643
|
-
end
|
644
|
-
|
645
|
-
describe 'added favorites can be grouped by country' do
|
646
|
-
let(:range) { {since: ENV['YT_TEST_PARTNER_VIDEO_DATE']} }
|
647
|
-
|
648
|
-
specify 'with the :by option set to :country' do
|
649
|
-
favorites_added = video.favorites_added range.merge by: :country
|
650
|
-
expect(favorites_added.keys).to all(be_a String)
|
651
|
-
expect(favorites_added.keys.map(&:length).uniq).to eq [2]
|
652
|
-
expect(favorites_added.values).to all(be_an Integer)
|
653
|
-
end
|
654
|
-
end
|
655
|
-
|
656
|
-
describe 'removed favorites can be grouped by day' do
|
657
|
-
let(:range) { {since: 4.days.ago.to_date, until: 3.days.ago.to_date} }
|
658
|
-
let(:keys) { range.values }
|
659
|
-
|
660
|
-
specify 'with the :by option set to :day' do
|
661
|
-
favorites_removed = video.favorites_removed range.merge by: :day
|
662
|
-
expect(favorites_removed.keys).to eq range.values
|
663
|
-
end
|
664
|
-
end
|
665
|
-
|
666
|
-
# TODO: Remove "removed favorites" since it’s deprecated!
|
667
|
-
# describe 'removed favorites can be grouped by country' do
|
668
|
-
# let(:range) { {since: ENV['YT_TEST_PARTNER_VIDEO_DATE']} }
|
669
|
-
#
|
670
|
-
# specify 'with the :by option set to :country' do
|
671
|
-
# favorites_removed = video.favorites_removed range.merge by: :country
|
672
|
-
# expect(favorites_removed.keys).to all(be_a String)
|
673
|
-
# expect(favorites_removed.keys.map(&:length).uniq).to eq [2]
|
674
|
-
# expect(favorites_removed.values).to all(be_an Integer)
|
675
|
-
# end
|
676
|
-
# end
|
677
|
-
|
678
611
|
describe 'estimated minutes watched can be retrieved for a single US state' do
|
679
612
|
let(:state_code) { 'NY' }
|
680
613
|
let(:minutes) { video.estimated_minutes_watched since: date, by: by, in: location }
|
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.
|
4
|
+
version: 0.26.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claudio Baccigalupo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|