niconico 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/niconico/deferrable.rb +1 -1
- data/lib/niconico/mylist.rb +1 -1
- data/lib/niconico/version.rb +1 -1
- data/lib/niconico/video.rb +4 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 178df7276651dc0b9075d0cee6421c57ea0412a7
|
4
|
+
data.tar.gz: 3e6285ae48a8ff5c29c39bbcee1eb394be0be620
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d29f2441bd54014a1c94b26fa97865f70f089e2e7ce42f48230721b7327102e8bbe6170838a3b17ef777718584a7c44b4df028f09df2caa1889ad131e78d7dce
|
7
|
+
data.tar.gz: 51e778a8b3086e7239cf4f5172df862f46b3866b40d03f66655645223af69466efea25cd813745958330808e0aaa82e7294cdfb49e64f40b1d1c10422f08d253
|
data/lib/niconico/deferrable.rb
CHANGED
data/lib/niconico/mylist.rb
CHANGED
@@ -7,7 +7,7 @@ class Niconico
|
|
7
7
|
|
8
8
|
page = @agent.get(url = "http://www.nicovideo.jp/mylist/#{i.to_s.sub(/^mylist\//,"")}")
|
9
9
|
#require 'ir_b'; ir b
|
10
|
-
if page.search("script").map(&:inner_text).find{|x|
|
10
|
+
if page.search("script").map(&:inner_text).find{|x| /\tMylist\.preload/ =~ x }.match(/\tMylist\.preload\(\d+, (.+?)\);\n/)
|
11
11
|
json = JSON.parse($1)
|
12
12
|
#require 'pp'; pp json
|
13
13
|
json.sort_by{|item| item["create_time"].to_f }.map do |item|
|
data/lib/niconico/version.rb
CHANGED
data/lib/niconico/video.rb
CHANGED
@@ -14,7 +14,7 @@ class Niconico
|
|
14
14
|
deferrable :id, :title,
|
15
15
|
:description, :description_raw,
|
16
16
|
:url, :video_url, :type,
|
17
|
-
:tags, :mylist_comment
|
17
|
+
:tags, :mylist_comment, :api_data
|
18
18
|
|
19
19
|
def initialize(parent, video_id, defer=nil)
|
20
20
|
@parent = parent
|
@@ -51,8 +51,9 @@ class Niconico
|
|
51
51
|
end
|
52
52
|
getflv = Hash[@agent.get_file("#{Niconico::URL[:getflv]}?v=#{@thread_id}#{additional_params}").scan(/([^&]+)=([^&]+)/).map{|(k,v)| [k.to_sym,CGI.unescape(v)] }]
|
53
53
|
|
54
|
-
if
|
55
|
-
|
54
|
+
if api_data_node = @page.at("#watchAPIDataContainer")
|
55
|
+
@api_data = JSON.parse(api_data_node.text())
|
56
|
+
video_detail = @api_data["videoDetail"]
|
56
57
|
@title ||= video_detail["title"] if video_detail["title"]
|
57
58
|
@description ||= video_detail["description"] if video_detail["description"]
|
58
59
|
@tags ||= video_detail["tagList"].map{|e| e["tag"]}
|
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.1
|
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-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -84,3 +84,4 @@ signing_key:
|
|
84
84
|
specification_version: 4
|
85
85
|
summary: wrapper of Mechanize, optimized for nicovideo.
|
86
86
|
test_files: []
|
87
|
+
has_rdoc:
|