X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2Fwebsites%2Fdailymotion.rb;fp=src%2Fwebsites%2Fdailymotion.rb;h=0000000000000000000000000000000000000000;hb=6de408333ceb0d142f8fa0fef2571228e89c8fc1;hp=26b3d4f153dafad9efe8e2fd48c196cd6a6fdfe2;hpb=8e886df259246365023322b78f58e4037cb536a4;p=dead%2Fwhatever-dl.git diff --git a/src/websites/dailymotion.rb b/src/websites/dailymotion.rb deleted file mode 100644 index 26b3d4f..0000000 --- a/src/websites/dailymotion.rb +++ /dev/null @@ -1,56 +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' - -class Dailymotion < Website - - VALID_DAILYMOTION_URL_REGEX = /^(http:\/\/)?(www\.)?dailymotion\.com\/video\/(.+)$/ - - def self.owns_url?(url) - return url =~ VALID_DAILYMOTION_URL_REGEX - end - - - def get_video_url() - # Disable the family filter if necessary. - self.headers['Cookie'] = 'family_filter=off' - page_data = self.get_page_data(@url) - video_url = self.parse_video_url(page_data) - - return video_url - end - - - protected; - - # Get the FLV file URL from the HTML page for this movie. - # It's stored in some Flash variable. - def parse_video_url(page_data) - video_url_regex = /addVariable\(\"video\", \"([^\"]+)\"/i - matches = video_url_regex.match(page_data) - - if (matches.nil? || matches.length < 2) - raise StandardError.new('Could not find the "video" flash variable on the page.'); - end - - return matches[1] - end - - -end