Skip to content

Instantly share code, notes, and snippets.

# Convert XML Youtube subtitles to SubRip (srt) format
# To download the subtitle in XML, put de code of the Youtube video
# at the end of the next url:
# http://video.google.com/timedtext?hl=en&lang=en&v=
require 'rubygems'
require 'hpricot'
youtube_xml = ARGV[0]
xml = Hpricot.XML(open(youtube_xml))