Created
August 12, 2015 04:12
-
-
Save rehat/99b74b1e62cc91a8aa20 to your computer and use it in GitHub Desktop.
open inside HTML is open-uri and the open on line 4?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
page = Nokogiri::HTML(open(video_url)) | |
video_file_url_re.match(page) {|url| | |
open(save_file_as, 'wb') do |file| | |
file << open(url.to_s, | |
content_length_proc: proc { |total| | |
if total.to_i > 0 | |
progress_bar = ProgressBar.create(title: 'Downloaded', total: total) | |
end | |
}, | |
progress_proc: proc { |step| | |
progress_bar.progress = step | |
} | |
).read | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment