Last active
March 26, 2017 12:29
-
-
Save qq7/9077ec0690cd0f1a9d5c13b1baab5e54 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
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