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.
|
80
|
-
res = /cid=([0-9]*)/.match(i.to_s)
|
79
|
+
res = /secure,cid=([0-9]*)/.match(doc.to_s)
|
81
80
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
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)
|