#1866 update for new deviantart urls

This commit is contained in:
Toks
2015-03-13 14:12:17 -04:00
parent 097914ca67
commit 04e6aa7474
3 changed files with 13 additions and 9 deletions

View File

@@ -22,12 +22,16 @@ module Downloads
end
def rewrite_thumbnails(url, headers)
if url =~ %r{^(https?://.+?\.deviantart\.net/.+?/)200H/}
if url =~ %r{^(https?://(?:fc|th)\d{2}\.deviantart\.net/.+?/)200H/}
match = $1
url.sub!(match + "200H/", match)
elsif url =~ %r{^(https?://.+?\.deviantart\.net/.+?/)PRE/}
elsif url =~ %r{^(https?://(?:fc|th)\d{2}\.deviantart\.net/.+?/)PRE/}
match = $1
url.sub!(match + "PRE/", match)
elsif url =~ %r{^https?://(?:pre|img)\d{2}\.deviantart\.net/}
source = ::Sources::Strategies::DeviantArt.new(url)
source.get
return [source.image_url, headers]
end
return [url, headers]