Skip to content

Commit ccbe492

Browse files
committed
mp4decode download is working now
1 parent d043c12 commit ccbe492

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

train_portal/ice/videos.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
require 'open-uri'
77
require 'zip'
88

9+
if OpenSSL::SSL.const_defined?(:OP_IGNORE_UNEXPECTED_EOF)
10+
OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:options] |= OpenSSL::SSL::OP_IGNORE_UNEXPECTED_EOF
11+
end
12+
913
module TrainPortal::Ice
1014
module Videos
1115
module_function
@@ -188,7 +192,8 @@ def download_mp4decrypt(destination_path)
188192
zip_path = File.join(tmp_dir, 'bento4.zip')
189193

190194
File.open(zip_path, 'wb') do |file|
191-
file.write(URI.open(bento_url).open(open_timeout: READ_TIMEOUT, read_timeout: READ_TIMEOUT).read)
195+
uri = URI.parse(bento_url).open(open_timeout: READ_TIMEOUT, read_timeout: READ_TIMEOUT)
196+
file.write(uri.read)
192197
end
193198

194199
Zip::File.open(zip_path) do |zip_file|

0 commit comments

Comments
 (0)