more robust handling of deviant art urls

This commit is contained in:
Albert Yi
2018-07-10 14:56:33 -07:00
parent f9b63702bf
commit 4762de65e1

View File

@@ -112,8 +112,8 @@ module Sources
"http://fav.me/d#{$1}" "http://fav.me/d#{$1}"
elsif url =~ %r{\Ahttps?://www\.deviantart\.com/([^/]+)/art/} elsif url =~ %r{\Ahttps?://www\.deviantart\.com/([^/]+)/art/}
url url
elsif url =~ %r{deviantart\.com/art/} elsif url !~ %r{\Ahttps?://(?:fc|th|pre|orig|img|www)\.} && url =~ %r{\Ahttps?://(.+?)\.deviantart\.com/?(.*)}
url "https://www.deviantart.com/#{$1}/#{$2}"
else else
nil nil
end end