Skip to content

Instantly share code, notes, and snippets.

@dmitry
Created January 17, 2018 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmitry/1b065d7f4788cf6b7fbb189a7c1b0875 to your computer and use it in GitHub Desktop.
Save dmitry/1b065d7f4788cf6b7fbb189a7c1b0875 to your computer and use it in GitHub Desktop.
Download audio files
require 'open-uri'
require 'nokogiri'
domain = 'https://slavmir.fm'
Nokogiri::HTML(open(domain + '/blogs/programmy')).css('.article_preview').to_a.each do |v|
url = domain + v.attributes['href'].value
Nokogiri::HTML(open(url)).css('.track-play').to_a.each do |z|
`curl "#{z.attributes['data-play-music'].value}" -O`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment