bilibili_sunday 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -76,17 +76,13 @@ module BilibiliSunday
76
76
  def cid_for_video_url(url)
77
77
  doc = Nokogiri::HTML(gzip_inflate(@cacher.read_url(url)))
78
78
 
79
- doc.css('.scontent').each do |i|
80
- res = /cid=([0-9]*)/.match(i.to_s)
79
+ res = /secure,cid=([0-9]*)/.match(doc.to_s)
81
80
 
82
- if res && res[1]
83
- return res[1].to_i
84
- else
85
- raise "Not a valid Bilibili video page URL. "
86
- end
81
+ if res && res[1]
82
+ return res[1].to_i
83
+ else
84
+ raise "Not a valid Bilibili video page URL. "
87
85
  end
88
-
89
- raise "Not a valid Bilibili video page URL. "
90
86
  end
91
87
 
92
88
  def title_for_video_url(url)
@@ -1,3 +1,3 @@
1
1
  module BilibiliSunday
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bilibili_sunday
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: