X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2Fwebsites%2Fredtube.rb;fp=src%2Fwebsites%2Fredtube.rb;h=0000000000000000000000000000000000000000;hb=6de408333ceb0d142f8fa0fef2571228e89c8fc1;hp=78480c96c9969b5c21416b20506f9c8f98e93b64;hpb=8e886df259246365023322b78f58e4037cb536a4;p=dead%2Fwhatever-dl.git diff --git a/src/websites/redtube.rb b/src/websites/redtube.rb deleted file mode 100644 index 78480c9..0000000 --- a/src/websites/redtube.rb +++ /dev/null @@ -1,77 +0,0 @@ -# -# Copyright Michael Orlitzky -# -# http://michael.orlitzky.com/ -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# http://www.fsf.org/licensing/licenses/gpl.html - -require 'src/website' -require 'cgi' - - -class Redtube < Website - - VALID_REDTUBE_URL_REGEX = /^(http:\/\/)?(www\.)?redtube\.com\/(\d+)$/ - - def self.owns_url?(url) - return url =~ VALID_REDTUBE_URL_REGEX - end - - - def get_video_url() - page_data = self.get_page_data(@url) - begin - # We prefer to parse the HTML5 version because it can come in a - # nicer container format. - return parse_html5_src(page_data) - rescue StandardError - return self.parse_hashlink(page_data) - end - end - - - protected; - - def parse_video_id() - return /\d+/.match(@url)[0] - end - - - def parse_html5_src(page_data) - html5_src_regex = /\"