artstation: fix source to page url after download.

This commit is contained in:
evazion
2017-06-06 13:01:49 -05:00
parent a68ff3c347
commit 215569fbe0

View File

@@ -57,7 +57,7 @@ module Downloads
def after_download(src) def after_download(src)
src = fix_twitter_sources(src) src = fix_twitter_sources(src)
if options[:referer_url].present? if options[:referer_url].present?
src = set_source_to_referer(src) src = set_source_to_referer(src, options[:referer_url])
end end
src src
end end
@@ -137,12 +137,13 @@ module Downloads
end end
end end
def set_source_to_referer(src) def set_source_to_referer(src, referer)
if Sources::Strategies::Nijie.url_match?(src) || if Sources::Strategies::Nijie.url_match?(src) ||
Sources::Strategies::Twitter.url_match?(src) || Sources::Strategies::Twitter.url_match?(src) ||
Sources::Strategies::Tumblr.url_match?(src) || Sources::Strategies::Tumblr.url_match?(src) ||
Sources::Strategies::Pawoo.url_match?(src) Sources::Strategies::Pawoo.url_match?(src) ||
strategy = Sources::Site.new(src, :referer_url => options[:referer_url]) Sources::Strategies::ArtStation.url_match?(src) || Sources::Strategies::ArtStation.url_match?(referer)
strategy = Sources::Site.new(src, :referer_url => referer)
strategy.referer_url strategy.referer_url
else else
src src