Skip to content

Instantly share code, notes, and snippets.

@maier-stefan
Last active August 29, 2015 14:08
Show Gist options
  • Save maier-stefan/0dbb00c2f66ff9099dee to your computer and use it in GitHub Desktop.
Save maier-stefan/0dbb00c2f66ff9099dee to your computer and use it in GitHub Desktop.
Video Grab
require 'open-uri'
url = "http://www.domain.com/embed/44bc40f3bc04f65b7a35"
video_page = open(url).read
video = video_page[/'http(.*?)mp4(.*?)'/]
puts download_url = video.tr("'",'')
new_file_path = "/Users/name/Projects/loader/your_video.mp4"
open(new_file_path, "wb") do |file|
file.print open(download_url).read
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment