diff --git a/app/logical/sources/strategies/deviant_art.rb b/app/logical/sources/strategies/deviant_art.rb index 11a463282..cd7193a65 100644 --- a/app/logical/sources/strategies/deviant_art.rb +++ b/app/logical/sources/strategies/deviant_art.rb @@ -5,6 +5,14 @@ module Sources url =~ /^https?:\/\/(?:.+?\.)?deviantart\.(?:com|net)/ end + def referer_url(template) + if template.params[:ref] =~ /deviantart\.com\/art\// + template.params[:ref] + else + template.params[:url] + end + end + def site_name "Deviant Art" end diff --git a/app/logical/sources/strategies/nico_seiga.rb b/app/logical/sources/strategies/nico_seiga.rb index e58a7dffc..32f5cad7c 100644 --- a/app/logical/sources/strategies/nico_seiga.rb +++ b/app/logical/sources/strategies/nico_seiga.rb @@ -5,6 +5,14 @@ module Sources url =~ /^https?:\/\/(?:\w+\.)?nico(?:seiga|video)\.jp/ end + def referer_url(template) + if template.params[:ref] =~ /seiga\.nicovideo\.jp\/seiga\/im\d+/ + template.params[:ref] + else + template.params[:url] + end + end + def site_name "Nico Seiga" end