niconico 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 178df7276651dc0b9075d0cee6421c57ea0412a7
4
- data.tar.gz: 3e6285ae48a8ff5c29c39bbcee1eb394be0be620
3
+ metadata.gz: f18309964d6f29767de3ae7b97e2fb729cb128a8
4
+ data.tar.gz: a435cf5c3044951a6068df200298a062a2f88b1e
5
5
  SHA512:
6
- metadata.gz: d29f2441bd54014a1c94b26fa97865f70f089e2e7ce42f48230721b7327102e8bbe6170838a3b17ef777718584a7c44b4df028f09df2caa1889ad131e78d7dce
7
- data.tar.gz: 51e778a8b3086e7239cf4f5172df862f46b3866b40d03f66655645223af69466efea25cd813745958330808e0aaa82e7294cdfb49e64f40b1d1c10422f08d253
6
+ metadata.gz: 1e561eea62e13e2f9d91ebc2da2250d943fd4e9162d7c26a931c1518bc3e2f907f7528f4103fb5092568a5be5a37957c7c2a69979fb6e8712828d35454f7daa7
7
+ data.tar.gz: b0e9642cc454d46d145206c73b4da59980a76ca22afaf2de505847da4f2e8f4cfb0317b76434506c9f7d3ad4a9af1f4bb6ef577a417c4cf368355010734039cf
data/lib/niconico/live.rb CHANGED
@@ -158,6 +158,15 @@ class Niconico
158
158
  seat[:quesheet]
159
159
  end
160
160
 
161
+ def execute_rtmpdump(file_base, ignore_failure = false)
162
+ rtmpdump_commands(file_base).map do |cmd|
163
+ system *cmd
164
+ retval = $?
165
+ raise RtmpdumpFailed, "#{cmd.inspect} failed" if !retval.success? && !ignore_failure
166
+ [cmd, retval]
167
+ end
168
+ end
169
+
161
170
  def rtmpdump_commands(file_base)
162
171
  file_base = File.expand_path(file_base)
163
172
 
@@ -167,7 +176,7 @@ class Niconico
167
176
 
168
177
  plays = quesheet.select{ |_| /^\/play / =~ _[:body] }
169
178
 
170
- plays.map.with_index do |play, i|
179
+ plays.flat_map.with_index do |play, i|
171
180
  cases = play[:body].sub(/^case:/,'').split(/ /)[1].split(/,/)
172
181
  publish_id = nil
173
182
 
@@ -198,7 +207,7 @@ class Niconico
198
207
  '--app', URI.parse(self.rtmp_url).path.sub(/^\//,'')
199
208
  ]
200
209
  end
201
- end.flatten(1)
210
+ end
202
211
  end
203
212
  end
204
213
  end
@@ -7,7 +7,7 @@ class Niconico
7
7
  #
8
8
  # options[:method] -> :fav, :view, :comment, :mylist
9
9
  # (or :all) (or :res)
10
- def ranking(category, options={})
10
+ def ranking(category = 'all', options={})
11
11
  login unless @logined
12
12
 
13
13
  span = options[:span] || :daily
@@ -22,7 +22,7 @@ class Niconico
22
22
  method = :fav if method == :all
23
23
 
24
24
  page = @agent.get(url = "http://www.nicovideo.jp/ranking/#{method}/#{span}/#{category}")
25
- page.search("a.watch").map do |link|
25
+ page.search(".ranking.itemTitle a").map do |link|
26
26
  Video.new(self, link['href'].sub(/^.*?watch\//,""), title: link.inner_text)
27
27
  end
28
28
  end
@@ -1,3 +1,3 @@
1
1
  class Niconico
2
- VERSION = "1.4.1"
2
+ VERSION = "1.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: niconico
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shota Fukumori (sora_h)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-18 00:00:00.000000000 Z
11
+ date: 2014-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
@@ -84,4 +84,3 @@ signing_key:
84
84
  specification_version: 4
85
85
  summary: wrapper of Mechanize, optimized for nicovideo.
86
86
  test_files: []
87
- has_rdoc: