potential fix for #2404
This commit is contained in:
@@ -3,22 +3,22 @@
|
||||
module Sources
|
||||
class Site
|
||||
attr_reader :url, :strategy
|
||||
delegate :get, :get_size, :referer_url, :site_name, :artist_name,
|
||||
delegate :get, :get_size, :site_name, :artist_name,
|
||||
:profile_url, :image_url, :tags, :artist_record, :unique_id,
|
||||
:page_count, :file_url, :ugoira_frame_data, :image_urls,
|
||||
:has_artist_commentary?, :artist_commentary_title,
|
||||
:artist_commentary_desc, :to => :strategy
|
||||
:artist_commentary_desc, :referer_url, :to => :strategy
|
||||
|
||||
def self.strategies
|
||||
[Strategies::Pixiv, Strategies::NicoSeiga, Strategies::DeviantArt, Strategies::Nijie, Strategies::Twitter]
|
||||
end
|
||||
|
||||
def initialize(url)
|
||||
def initialize(url, options = {})
|
||||
@url = url
|
||||
|
||||
Site.strategies.each do |strategy|
|
||||
if strategy.url_match?(url)
|
||||
@strategy = strategy.new(url)
|
||||
@strategy = strategy.new(url, options[:referer_url])
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user