Skip to content

Instantly share code, notes, and snippets.

@qq7
Last active March 26, 2017 12:29
Show Gist options
  • Save qq7/9077ec0690cd0f1a9d5c13b1baab5e54 to your computer and use it in GitHub Desktop.
Save qq7/9077ec0690cd0f1a9d5c13b1baab5e54 to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'nokogiri'
(1..20).each do |season|
begin
(1..15).each do |episode|
voice_original = '&voice=3'
if episode <= 9
url = "http://southpark.cc-fan.tv/series.php?id=#{season}0#{episode}#{voice_original}"
else
url = "http://southpark.cc-fan.tv/series.php?id=#{season}#{episode}#{voice_original}"
end
source_code = Nokogiri::HTML(open(url))
script = source_code.css('script')[19].text
file = script[/http:\/\/m.+mp4/]
puts file
end
rescue NoMethodError
# ignored
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment