Skip to content

Instantly share code, notes, and snippets.

@ssig33
Created February 9, 2012 05:53
Show Gist options
  • Save ssig33/1777703 to your computer and use it in GitHub Desktop.
Save ssig33/1777703 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
#coding:utf-8
require 'mechanize'
alice = Mechanize.new
page = alice.get ARGV[0]
url = CGI.unescape page.root.xpath('//*[@id="flash-player-embed"]')[0]['flashvars'].split('&flv_url=').last.split('&').first
title = page.root.xpath('//td/strong')[0].inner_text.gsub(/\//, '/')+'.flv'
system "wget", url, "-O", title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment