yourub 1.0.9 → 1.0.10
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/lib/yourub/client.rb +14 -10
- data/lib/yourub/reader.rb +3 -1
- data/lib/yourub/version.rb +1 -1
- data/spec/client_spec.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a4c6a883b4aabec736c7dfdbd564930455070bd
|
4
|
+
data.tar.gz: 400abbb415acc47fcd28723e4a4a5fd9e8bec9cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1025ebe899c9f2b6a71a22b368fca7846750855b4cd58a71aff84cbe97384b96d73fc2bc9e73292021d5f610f2cb1ef5f7ac593acbbe996315f0ccef439dae1
|
7
|
+
data.tar.gz: 7de65afde81961d9ccd23186e921feda72dbba3fd74a244e70f62d672c10cd1779ced46f8eeb0b2cb3c88a382ad12224d45aa974bbf854a45edaf709dda64182
|
data/lib/yourub/client.rb
CHANGED
@@ -68,8 +68,8 @@ module Yourub
|
|
68
68
|
:api_method => youtube.videos.list,
|
69
69
|
:parameters => params
|
70
70
|
)
|
71
|
-
entry = Yourub::Reader.parse_videos(video_response)
|
72
|
-
add_video_to_search_result(entry) unless entry.nil?
|
71
|
+
entry = Yourub::Reader.parse_videos(video_response)
|
72
|
+
add_video_to_search_result(entry.first) unless entry.nil?
|
73
73
|
end
|
74
74
|
|
75
75
|
def merge_criteria_with_api_options
|
@@ -97,12 +97,16 @@ module Yourub
|
|
97
97
|
|
98
98
|
def retrieve_videos
|
99
99
|
consume_criteria do |criteria|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
100
|
+
begin
|
101
|
+
req = search_list_request(criteria)
|
102
|
+
if @extended_info || Yourub::CountFilter.filter
|
103
|
+
get_details_and_store req
|
104
|
+
else
|
105
|
+
videos = Yourub::Reader.parse_videos(req)
|
106
|
+
videos.each{ |v| add_video_to_search_result(v) }
|
107
|
+
end
|
108
|
+
rescue StandardError => e
|
109
|
+
Yourub.logger.error "Error #{e} retrieving videos for the criteria: #{criteria.to_s}"
|
106
110
|
end
|
107
111
|
end
|
108
112
|
end
|
@@ -135,8 +139,8 @@ module Yourub
|
|
135
139
|
def get_details_and_store(video_list)
|
136
140
|
video_list.data.items.each do |video_item|
|
137
141
|
v = videos_list_request video_item.id.videoId
|
138
|
-
v = Yourub::Reader.parse_videos(v)
|
139
|
-
add_video_to_search_result(v)
|
142
|
+
v = Yourub::Reader.parse_videos(v)
|
143
|
+
add_video_to_search_result(v.first) if v
|
140
144
|
end
|
141
145
|
end
|
142
146
|
|
data/lib/yourub/reader.rb
CHANGED
data/lib/yourub/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED