niconico 1.5.0 → 1.6.0
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/niconico.rb +2 -5
- data/lib/niconico/live/api.rb +1 -1
- data/lib/niconico/version.rb +1 -1
- 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: 51a70da9e364d8d29e8fd3f9834056d211957cc8
|
|
4
|
+
data.tar.gz: 952d992157597985457145d55bb2df3702f45d2d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a633dad1e1abc5935908492f742b93af3e2a863506a046d6ba9984e9bbd1e06037a62185831549253c106265db81eb751a401fe61cca6b4cec47d039a55d3772
|
|
7
|
+
data.tar.gz: 4091116e411bd79762ed660fb42f5ac994606f6092143ef08c46210037b1998cb3da0071e245db1561330bc1abcde344b7d160069d3e02715149fba60b3fd2e4
|
data/lib/niconico.rb
CHANGED
|
@@ -12,8 +12,6 @@ class Niconico
|
|
|
12
12
|
getflv: 'http://flapi.nicovideo.jp/api/getflv'
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
TEST_VIDEO_ID = "sm9"
|
|
16
|
-
|
|
17
15
|
attr_reader :agent
|
|
18
16
|
|
|
19
17
|
def logged_in?; @logged_in; end
|
|
@@ -37,7 +35,6 @@ class Niconico
|
|
|
37
35
|
|
|
38
36
|
@agent = Mechanize.new.tap do |agent|
|
|
39
37
|
agent.user_agent = "Niconico.gem (#{Niconico::VERSION}, https://github.com/sorah/niconico)"
|
|
40
|
-
agent.ssl_version = 'SSLv3'
|
|
41
38
|
|
|
42
39
|
agent.cookie_jar.add(
|
|
43
40
|
HTTP::Cookie.new(
|
|
@@ -84,7 +81,7 @@ class Niconico
|
|
|
84
81
|
def login_with_email
|
|
85
82
|
page = @agent.post(URL[:login], 'mail' => @mail, 'password' => @pass)
|
|
86
83
|
|
|
87
|
-
raise LoginError, "Failed to
|
|
84
|
+
raise LoginError, "Failed to log in (x-niconico-authflag is 0)" if page.header["x-niconico-authflag"] == '0'
|
|
88
85
|
@token = nil
|
|
89
86
|
@logged_in = true
|
|
90
87
|
end
|
|
@@ -98,7 +95,7 @@ class Niconico
|
|
|
98
95
|
)
|
|
99
96
|
|
|
100
97
|
page = @agent.get(URL[:top])
|
|
101
|
-
raise LoginError, "Failed to
|
|
98
|
+
raise LoginError, "Failed to log in (x-niconico-authflag is 0)" if page.header["x-niconico-authflag"] == '0'
|
|
102
99
|
|
|
103
100
|
@logged_in = true
|
|
104
101
|
end
|
data/lib/niconico/live/api.rb
CHANGED
|
@@ -24,7 +24,7 @@ class Niconico
|
|
|
24
24
|
comment_area = page.at("#comment_area#{id}").inner_text
|
|
25
25
|
|
|
26
26
|
result = {
|
|
27
|
-
title: page.at('h2 span').inner_text,
|
|
27
|
+
title: page.at('h2 span[itemprop="name"]').inner_text,
|
|
28
28
|
id: id,
|
|
29
29
|
description: page.at('.stream_description .text_area').inner_html,
|
|
30
30
|
}
|
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
|
+
version: 1.6.0
|
|
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-12-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mechanize
|