Skip to content

Instantly share code, notes, and snippets.

@bastianwegge
Last active April 10, 2018 19:53
Show Gist options
  • Save bastianwegge/129bb9aadb89840dcd832af980c2a068 to your computer and use it in GitHub Desktop.
Save bastianwegge/129bb9aadb89840dcd832af980c2a068 to your computer and use it in GitHub Desktop.
download script <3 pierre
require 'nokogiri'
require 'httparty'
doc = Nokogiri::XML(HTTParty.get("https://www.google.de").body)
doc.css('link').map{ |a| a.text }.each do |link|
begin
source = HTTParty.get(link).body
url = source.scan(/"https:\/\/.*\.mp4.*"/).first
`wget #{url}`
# p url
rescue
retry
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment