Created
July 5, 2014 06:41
-
-
Save ssig33/11757d0d45048a378869 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/ruby | |
require 'rss' | |
require 'open-uri' | |
require 'uri' | |
# 日本人っぽいのだけ欲しい場合' | |
URL = 'http://xpathfeed.com/feed?url=http%3A%2F%2Fjp.xvideos.com%2F&xpath_list=%2F%2F*%5B%40class%3D%22thumbBlock%22%5D%2Fdiv%2Fp%5B1%5D%2Fa' | |
RSS::Parser.parse(open(URL).read).channel.items.each{|x| | |
uri = URI.parse x.link | |
uri.host ='www.xvideos.com' | |
puts uri.to_s | |
} |
ラッパーこういうの。
#!/usr/bin/env ruby
require 'dbm'
url = ARGV[0]
dbm = DBM.new('xvideos.db')
unless dbm[url]
system 'youtube-dl', url
dbm[url] = 'downloaded'
end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ダウンロードしたかどうか管理したい場合は xargs の先で実行するコマンドをダウンロードしたかどうか判断してから youtube-dl 起動するラッパーとかにすればいいんじゃないでしょうか。