onebox 1.3.6 → 1.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onebox/engine/youtube_onebox.rb +8 -2
- data/lib/onebox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28e966aab6b9cb159a61e21ba464d8587c2c0f74
|
4
|
+
data.tar.gz: afc48dab705818660e618ce917fd0e88f17a884c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 349acadd62a19705a0932560807790914ff0a428a826d3bbde23f5fa19bb32518f94a556153f6aea4496718018b3f06af332f62ad7bc937c958eb3199f4493cb
|
7
|
+
data.tar.gz: 11db97325e4ed5a5487ffe8a14a1ab6ffad21265031fa687d1fcce77b683273cea1d9f177eb4ea45d55d07ae8314ae376a790476b127fa6ba09dc3d5f807bf8c
|
@@ -39,8 +39,14 @@ module Onebox
|
|
39
39
|
def append_params(html)
|
40
40
|
result = html.dup
|
41
41
|
result.gsub! /(src="[^"]+)/, '\1&wmode=opaque'
|
42
|
-
if url =~ /t=(\d+)
|
43
|
-
|
42
|
+
if url =~ /t=(\d+h)?(\d+m)?(\d+s?)?/
|
43
|
+
h = Regexp.last_match[1].to_i
|
44
|
+
m = Regexp.last_match[2].to_i
|
45
|
+
s = Regexp.last_match[3].to_i
|
46
|
+
|
47
|
+
total = (h * 60 * 60) + (m * 60) + s
|
48
|
+
|
49
|
+
result.gsub! /(src="[^"]+)/, '\1&start=' + total.to_s
|
44
50
|
end
|
45
51
|
result
|
46
52
|
end
|
data/lib/onebox/version.rb
CHANGED