Created
June 2, 2014 08:17
-
-
Save ironsand/a6a4bbc01ad7807c6b4e to your computer and use it in GitHub Desktop.
dotinstallから動画をまとめてダウンロードを途中でめんどくさくなってやめたスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'nokogiri' | |
| require 'open-uri' | |
| require 'selenium-webdriver' | |
| driver = Selenium::WebDriver.for :firefox | |
| doc = Nokogiri::HTML open ARGV[0] | |
| urls = doc.search("a.lesson_title").map{|n| n['href']} | |
| vimeo_urls = urls.map do |url| | |
| driver.navigate.to "http://dotinstall.com#{url}" | |
| doc = driver.page_source | |
| doc.css("iframe#vimeo_player").first[:src] | |
| end | |
| vimeo_urls.each{|url| $stdout.puts url } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment