nicovideo 0.0.5 → 0.0.6

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.
data/ChangeLog CHANGED
@@ -1,6 +1,10 @@
1
+ 2008-02-16 version 0.0.6
2
+
3
+ * fixed bug of downloading video via mylist
4
+
1
5
  2008-02-03 version 0.0.5
2
6
 
3
- * added getter to Nicovideo::Base#agent(WWW::Mechanize object)
7
+ * added the getter method to Nicovideo::Base#agent(WWW::Mechanize object)
4
8
  * fixed typo of agent's get method
5
9
 
6
10
  2008-02-02 version 0.0.4
@@ -105,6 +105,16 @@ module Nicovideo
105
105
  OpenList.new(@agent, video_id)
106
106
  end
107
107
 
108
+ # not implemented
109
+ def ranking options=nil
110
+ Ranking.new(@agent, options)
111
+ end
112
+
113
+ # not implemented
114
+ def search option=nil
115
+ Search.new(@agent, options)
116
+ end
117
+
108
118
  private
109
119
  def get_videopage(video_id)
110
120
  if @vp.nil? || video_id != @vp.video_id
@@ -2,7 +2,7 @@ module Nicovideo #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 5
5
+ TINY = 6
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -73,7 +73,7 @@ module Nicovideo
73
73
  begin
74
74
  unless @params
75
75
  puts_info 'getting params : id = ' + @video_id
76
- @page = get_videopage unless @page
76
+ @page ||= get_page(@url)
77
77
  content = @agent.get_file(BASE_URL + '/api/getflv?v=' + @video_id)
78
78
  puts_debug content
79
79
  @params = content.scan(/([^&]+)=([^&]*)/).inject({}){|h, v| h[v[0]] = v[1]; h}
@@ -7,12 +7,21 @@ class TestNicovideoVideoPage < Test::Unit::TestCase
7
7
  @nv = Nicovideo.new(account['mail'], account['password'])
8
8
  @nv.login
9
9
 
10
- @vid_valid = 'sm500873' # 閲覧可能(組曲)
10
+ # @vid_valid = 'sm500873' # 閲覧可能(組曲)
11
+ @vid_valid = 'sm1892625' # 閲覧可能(短い動画)
11
12
  @vid_invalid = 'smfdsafd' # IDが間違っている
12
13
  @vid_notfound = 'sm500875' # 削除済み
13
14
  end
14
15
 
15
16
  # TODO: add test cases of openlist and mylist
17
+ def test_watch_ikinari
18
+ vp = nil
19
+ assert_nothing_raised {
20
+ vp = @nv.watch(@vid_valid)
21
+ }
22
+ assert_nothing_raised { vp.flv }
23
+ end
24
+ =begin
16
25
  def test_watch_valid
17
26
  vp = nil
18
27
  assert_nothing_raised {
@@ -27,8 +36,10 @@ class TestNicovideoVideoPage < Test::Unit::TestCase
27
36
  puts vp.tags
28
37
  puts vp.title
29
38
  puts vp.published_at
30
- # assert_instance_of(String, vp.flv)
31
- # assert_instance_of(String, vp.video)
39
+ assert_nothing_raised { vp.flv }
40
+ #assert_instance_of(String, vp.flv)
41
+ #assert_instance_of(String, vp.video)
42
+ File.open("#{@vid_valid}.flv", "wb") {|f| f.write vp.flv }
32
43
 
33
44
  sleep 1
34
45
  end
@@ -81,4 +92,5 @@ class TestNicovideoVideoPage < Test::Unit::TestCase
81
92
 
82
93
  sleep 1
83
94
  end
95
+ =end
84
96
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: nicovideo
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.5
7
- date: 2008-02-03 00:00:00 +09:00
6
+ version: 0.0.6
7
+ date: 2008-02-16 00:00:00 +09:00
8
8
  summary: utils for nicovideo
9
9
  require_paths:
10
10
  - lib