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 +4 -4
- data/lib/niconico/live.rb +11 -2
- data/lib/niconico/ranking.rb +2 -2
- data/lib/niconico/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f18309964d6f29767de3ae7b97e2fb729cb128a8
|
4
|
+
data.tar.gz: a435cf5c3044951a6068df200298a062a2f88b1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
210
|
+
end
|
202
211
|
end
|
203
212
|
end
|
204
213
|
end
|
data/lib/niconico/ranking.rb
CHANGED
@@ -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
|
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
|
data/lib/niconico/version.rb
CHANGED
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.
|
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-
|
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:
|