Skip to content

Instantly share code, notes, and snippets.

@jaeyson
Forked from ckahle33/das.rb
Created June 2, 2026 00:56
Show Gist options
  • Select an option

  • Save jaeyson/c7f49c1bfd3209469848d745d13a0ac2 to your computer and use it in GitHub Desktop.

Select an option

Save jaeyson/c7f49c1bfd3209469848d745d13a0ac2 to your computer and use it in GitHub Desktop.
# gem install mechanize
require 'mechanize'
class Download
def initialize(site, email, pass)
@options = {site: site, email: email, pass: pass}
end
def call
agent = Mechanize.new
page = agent.get("#{@options[:site]}/screencasts/users/sign_in")
form = page.forms.first
form['user[email]'] = @options[:email]
form['user[password]'] = @options[:pass]
form.submit
agent.page.links[1].click
arr = agent.page.search('.episode')
if arr.any?
puts ".episode attribute found!"
arr.each_with_index do |l, i|
agent.get(l.search('a').attribute('href'))
title = agent.page.title.strip
agent.get( agent.page.search('script').text.split("\"")[7])
agent.page.save("#{i} - #{title}.mp4")
puts "Downloading #{i} - #{title}..."
title = ""
2.times { agent.back }
end
else
puts "No .episode attribute found!"
end
end
end
Download.new('https://www.destroyallsoftware.com', 'your@email.com', 'yourPass').call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment