Implement #2395 for nijie twitter and tumblr

This commit is contained in:
Toks
2015-06-13 11:26:47 -04:00
parent 7360fc4633
commit 462e1ed324
6 changed files with 48 additions and 6 deletions

View File

@@ -57,6 +57,9 @@ module Downloads
def after_download(src)
src = fix_image_board_sources(src)
src = fix_twitter_sources(src)
if options[:referer_url].present?
src = set_source_to_referer(src)
end
src
end
@@ -131,5 +134,14 @@ module Downloads
src
end
end
def set_source_to_referer(src)
if Sources::Strategies::Nijie.url_match?(src) || Sources::Strategies::Twitter.url_match?(src) || Sources::Strategies::Tumblr.url_match?(src)
strategy = Sources::Site.new(src, :referer_url => options[:referer_url])
strategy.referer_url
else
src
end
end
end
end