Skip to content

Instantly share code, notes, and snippets.

@ssig33
Created November 1, 2012 03:59
Show Gist options
  • Save ssig33/3991602 to your computer and use it in GitHub Desktop.
Save ssig33/3991602 to your computer and use it in GitHub Desktop.
xvideo から動画ダウンロードするやつ
#!/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('//div[@id="main"]/h2')[0].inner_text.to_s+'.flv'
system "wget", url, "-O", title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment