From f58564a71f3958eb88ecda97b14908e3ad866670 Mon Sep 17 00:00:00 2001 From: lllusion3469 <31420484+lllusion3469@users.noreply.github.com> Date: Sun, 10 May 2020 20:34:36 +0200 Subject: [PATCH] deviantart: don't rewrite download url it's all handled through something like https://api-da.wixmp.com/_api/download/file?downloadToken=$TOKEN now so those modifications aren't necessary anymore. In fact, the one to "strip s3 query params" removes the token, breaking the download url. --- app/logical/sources/strategies/deviant_art.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/logical/sources/strategies/deviant_art.rb b/app/logical/sources/strategies/deviant_art.rb index 1557586af..b4b785074 100644 --- a/app/logical/sources/strategies/deviant_art.rb +++ b/app/logical/sources/strategies/deviant_art.rb @@ -83,11 +83,7 @@ module Sources if api_deviation.blank? [url] elsif api_deviation[:is_downloadable] - src = api_download[:src] - src.sub!(%r!\Ahttps?://s3\.amazonaws\.com/!i, "https://") - src.sub!(/\?.*\z/, "") # strip s3 query params - src.sub!(%r!\Ahttps://origin-orig\.deviantart\.net!, "http://origin-orig.deviantart.net") # https://origin-orig.devianart.net doesn't work - [src] + [api_download[:src]] elsif api_deviation.present? src = api_deviation.dig(:content, :src) if deviation_id && deviation_id.to_i <= 790677560 && src =~ /^https:\/\/images-wixmp-/