From 215569fbe01c45de8dd9e35a2d2c9069c6e2ceb3 Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 6 Jun 2017 13:01:49 -0500 Subject: [PATCH] artstation: fix source to page url after download. --- app/logical/downloads/file.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/logical/downloads/file.rb b/app/logical/downloads/file.rb index 2d9d39c5c..ffd2b6809 100644 --- a/app/logical/downloads/file.rb +++ b/app/logical/downloads/file.rb @@ -57,7 +57,7 @@ module Downloads def after_download(src) src = fix_twitter_sources(src) if options[:referer_url].present? - src = set_source_to_referer(src) + src = set_source_to_referer(src, options[:referer_url]) end src end @@ -137,12 +137,13 @@ module Downloads end end - def set_source_to_referer(src) + def set_source_to_referer(src, referer) if Sources::Strategies::Nijie.url_match?(src) || Sources::Strategies::Twitter.url_match?(src) || Sources::Strategies::Tumblr.url_match?(src) || - Sources::Strategies::Pawoo.url_match?(src) - strategy = Sources::Site.new(src, :referer_url => options[:referer_url]) + Sources::Strategies::Pawoo.url_match?(src) || + Sources::Strategies::ArtStation.url_match?(src) || Sources::Strategies::ArtStation.url_match?(referer) + strategy = Sources::Site.new(src, :referer_url => referer) strategy.referer_url else src