Created
July 16, 2013 22:34
-
-
Save Sakurina/6015792 to your computer and use it in GitHub Desktop.
build your own Sound Voltex soundtrack because Konami won't make one for some reason
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
# build your own SDVX soundtrack | |
# grabs all the YouTube URLs for konemi's SDVX lineouts | |
# and makes a shell script that downloads them and turns them to MP3s | |
# | |
# requires: youtube-dl, ffmpeg | |
# usage: ruby sdvx-gst.rb > sdvx-gst.sh | |
# | |
# hey konami, it's kind of dumb we can't pay you to get these songs, just sayin' | |
require 'rubygems' | |
require 'open-uri' | |
require 'nokogiri' | |
roots = ["http://sdvx.5com.info/sound2.htm", "http://sdvx.5com.info/sound.htm"] | |
youtube_urls = [] | |
def sane_url(path) | |
"http://sdvx.5com.info/#{path}" | |
end | |
roots.each do |root| | |
root_page = Nokogiri::HTML(open(root)) | |
subpages = root_page.css('a') | |
subpages.shift() | |
subpages.each do |subpage_link| | |
subpage_url = sane_url(subpage_link["href"]) | |
subpage = Nokogiri::HTML(open(subpage_url)) | |
links = subpage.css('a[href^="http://youtu.be"]') | |
links.each do |link| | |
youtube_urls << link["href"] | |
end | |
end | |
end | |
commands = youtube_urls.map do |url| | |
"youtube-dl -f 18 -x --audio-format mp3 \"#{url}\"" | |
end | |
puts commands.join "\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment