yt 0.25.20 → 0.25.22
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 -0
- data/lib/yt/collections/videos.rb +9 -3
- data/lib/yt/constants/geography.rb +3 -0
- data/lib/yt/version.rb +1 -1
- data/spec/requests/as_account/channel_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a98ff50d5e04357a8f4563cd528d9a38dbbaa50
|
|
4
|
+
data.tar.gz: 3e193cf14dbf64103d5f4b306054c4068f69e08c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62af53eb9f22c4d01422077dd2399c2c2c6ee40d73cf02af5a6b95c9f218d6c253004f2520b26060dcb5011270d5dec9cbc76ca24a14889eb941cfe1ab72b4d7
|
|
7
|
+
data.tar.gz: 744df99964bbd6b041f68c813200c78655380cf04f8f7d72385756247017e82a2225bf93ef286fdc18bf128d14678ef7300e127812a9a7a30615ee7217915664
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,14 @@ 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.25.22 - 2016-02-04
|
|
10
|
+
|
|
11
|
+
* [IMPROVEMENT] Deal with channels with more than 500 videos in a better way
|
|
12
|
+
|
|
13
|
+
## 0.25.21 - 2016-02-04
|
|
14
|
+
|
|
15
|
+
* [BUGFIX] Add required 'require' to have `.with_indifferent_access` in geography
|
|
16
|
+
|
|
9
17
|
## 0.25.20 - 2016-01-24
|
|
10
18
|
|
|
11
19
|
* [FEATURE] Add (undocumented) playback location dimensions SEARCH and BROWSE
|
|
@@ -77,7 +77,7 @@ module Yt
|
|
|
77
77
|
def next_page
|
|
78
78
|
super.tap do |items|
|
|
79
79
|
halt_list if use_list_endpoint? && items.empty? && @page_token.nil?
|
|
80
|
-
add_offset_to(items) if !use_list_endpoint? &&
|
|
80
|
+
add_offset_to(items) if !use_list_endpoint? && videos_params[:order] == 'date'
|
|
81
81
|
end
|
|
82
82
|
end
|
|
83
83
|
|
|
@@ -86,9 +86,15 @@ module Yt
|
|
|
86
86
|
# that limit, the query is restarted with a publishedBefore filter in
|
|
87
87
|
# case there are more videos to be listed for a channel
|
|
88
88
|
def add_offset_to(items)
|
|
89
|
-
|
|
89
|
+
@fetched_items ||= 0
|
|
90
|
+
if (@fetched_items += items.count) >= 500
|
|
90
91
|
last_published = items.last['snippet']['publishedAt']
|
|
91
|
-
|
|
92
|
+
last_published = DateTime.rfc3339(last_published) - 1.second
|
|
93
|
+
last_published = last_published.strftime '%FT%T.999Z'
|
|
94
|
+
@page_token, @published_before, @fetched_items = '', last_published, 0
|
|
95
|
+
elsif (1...50) === @last_index % 50
|
|
96
|
+
@halt_list, @page_token = true, nil
|
|
97
|
+
@last_index += items.size
|
|
92
98
|
end
|
|
93
99
|
end
|
|
94
100
|
|
data/lib/yt/version.rb
CHANGED
|
@@ -86,6 +86,7 @@ describe Yt::Channel, :device_app do
|
|
|
86
86
|
# of results to test that we can overcome YouTube’s limitation of only
|
|
87
87
|
# returning the first 500 results when ordered by date.
|
|
88
88
|
expect(channel.videos.count).to be > 500
|
|
89
|
+
expect(channel.videos.count).to eq channel.videos.map(&:id).uniq.count
|
|
89
90
|
expect(channel.videos.where(order: 'viewCount').count).to be 500
|
|
90
91
|
end
|
|
91
92
|
|
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.25.
|
|
4
|
+
version: 0.25.22
|
|
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-02-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|