Skip to content

Instantly share code, notes, and snippets.

@gittmaan
Forked from orlando/cheap_downloader.rb
Created April 6, 2018 02:02
Show Gist options
  • Save gittmaan/c7c615e09fc59208a1dc7ddf7d6da372 to your computer and use it in GitHub Desktop.
Save gittmaan/c7c615e09fc59208a1dc7ddf7d6da372 to your computer and use it in GitHub Desktop.
destroyallsoftware cheap screencast downloader
#!/usr/bin/ruby
require 'rss'
#this assumes you have a cookies.txt with destroyallsoftware.com cookies... later ill add a signin method..
class Link
attr_accessor :link,:title,:date
def initialize(link,title,date)
@link = link
@title = title
@date = date
end
def filename
"#{self.date.strftime("%F")}-#{self.link.split('/')[-2]}.mov"
end
def download
p %x(wget -c #{self.link} --load-cookies cookies.txt -O #{self.filename})
end
end
rss_string = open('https://www.destroyallsoftware.com/screencasts/feed').read
rss = RSS::Parser.parse(rss_string, false)
links = rss.items.map {|item| Link.new(item.link+"/download",item.title,item.pubDate)}
links.each do |link| link.download end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment