#1866 update for new deviantart urls
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user