X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2Fwebsites%2Fyikers.rb;fp=src%2Fwebsites%2Fyikers.rb;h=0000000000000000000000000000000000000000;hb=6de408333ceb0d142f8fa0fef2571228e89c8fc1;hp=9784cf5b27978038a7eea51ac3c0eb5aa0b88f7b;hpb=8e886df259246365023322b78f58e4037cb536a4;p=dead%2Fwhatever-dl.git diff --git a/src/websites/yikers.rb b/src/websites/yikers.rb deleted file mode 100644 index 9784cf5..0000000 --- a/src/websites/yikers.rb +++ /dev/null @@ -1,65 +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 Yikers < Website - - VALID_YIKERS_URL_REGEX = /^(http:\/\/)?(www\.)?yikers\.com\/([[:alnum:]_]+)\.html$/ - - def self.owns_url?(url) - return url =~ VALID_YIKERS_URL_REGEX - end - - - def get_video_url() - # The video URL is usually just a fixed location, with the file - # name from the page URL slightly modified. For example, - # - # http://www.yikers.com/video_the_best_rapper_in_the_world.html - # - # gets mapped to, - # - # http://cdn.yikers.com/flv/flash8/yikers_the_best_rapper_in_the_world.flv - # - file_name = get_video_filename().sub('video_', 'yikers_') - - video_url = "http://cdn.yikers.com/flv/flash8/#{file_name}" - - return video_url - end - - - def get_video_filename() - # Default to whatever comes after the final frontslash - # in the main URL. - filename = @url.split('/').pop() - - # These page URLs are actually descriptive, so we can use - # the file name of the HTML page as our video file name. - filename_regex = /\/([[:alnum:]_]+)\.html$/ - matches = filename_regex.match(@url) - - # Overwrite the default if our regex worked. - filename = matches[1] if not matches.nil? || matches.length < 1 - - return (filename + '.flv') - end - -end