From 4762de65e180443ce29dee209f0a878645ec486f Mon Sep 17 00:00:00 2001 From: Albert Yi Date: Tue, 10 Jul 2018 14:56:33 -0700 Subject: [PATCH] more robust handling of deviant art urls --- app/logical/sources/strategies/deviant_art.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/logical/sources/strategies/deviant_art.rb b/app/logical/sources/strategies/deviant_art.rb index 9a1019f84..4d5f7cb33 100644 --- a/app/logical/sources/strategies/deviant_art.rb +++ b/app/logical/sources/strategies/deviant_art.rb @@ -112,8 +112,8 @@ module Sources "http://fav.me/d#{$1}" elsif url =~ %r{\Ahttps?://www\.deviantart\.com/([^/]+)/art/} url - elsif url =~ %r{deviantart\.com/art/} - url + elsif url !~ %r{\Ahttps?://(?:fc|th|pre|orig|img|www)\.} && url =~ %r{\Ahttps?://(.+?)\.deviantart\.com/?(.*)} + "https://www.deviantart.com/#{$1}/#{$2}" else nil end