support artist-path urls in deviant art rewrite strategy (#3771)
This commit is contained in:
@@ -8,7 +8,7 @@ module Downloads
|
|||||||
end
|
end
|
||||||
|
|
||||||
def rewrite(url, headers, data = {})
|
def rewrite(url, headers, data = {})
|
||||||
if url =~ %r{deviantart\.com/art/} || url =~ %r{deviantart\.net/.+/[a-z0-9_]+(_by_[a-z0-9_]+)?-d([a-z0-9]+)\.}i
|
if url =~ %r{deviantart\.com/art/} || url =~ %r{\Ahttps?://www\.deviantart\.com/([^/]+)/art/} || url =~ %r{deviantart\.net/.+/[a-z0-9_]+(_by_[a-z0-9_]+)?-d([a-z0-9]+)\.}i
|
||||||
url, headers = rewrite_html_pages(url, headers)
|
url, headers = rewrite_html_pages(url, headers)
|
||||||
url, headers = rewrite_thumbnails(url, headers)
|
url, headers = rewrite_thumbnails(url, headers)
|
||||||
end
|
end
|
||||||
@@ -18,7 +18,7 @@ module Downloads
|
|||||||
|
|
||||||
protected
|
protected
|
||||||
def rewrite_html_pages(url, headers)
|
def rewrite_html_pages(url, headers)
|
||||||
if url =~ %r{^https?://.+?\.deviantart\.com/art/}
|
if url =~ %r{^https?://.+?\.deviantart\.com/art/} || url =~ %r{\Ahttps?://www\.deviantart\.com/([^/]+)/art/}
|
||||||
return [source.image_url, headers]
|
return [source.image_url, headers]
|
||||||
else
|
else
|
||||||
return [url, headers]
|
return [url, headers]
|
||||||
|
|||||||
Reference in New Issue
Block a user