artstation: normalize to www.artstation.com/artwork/$id for sidebar.
This commit is contained in:
@@ -529,6 +529,11 @@ class Post < ActiveRecord::Base
|
|||||||
when %r{\Ahttps?://(?:ayase\.|yuno\.|files\.)?yande\.re/(?:image|jpeg|sample)/(?<md5>[a-z0-9]{32})(?:/yande\.re.*|/?\.(?:jpg|png))\Z}i
|
when %r{\Ahttps?://(?:ayase\.|yuno\.|files\.)?yande\.re/(?:image|jpeg|sample)/(?<md5>[a-z0-9]{32})(?:/yande\.re.*|/?\.(?:jpg|png))\Z}i
|
||||||
"https://yande.re/post?tags=md5:#{$~[:md5]}"
|
"https://yande.re/post?tags=md5:#{$~[:md5]}"
|
||||||
|
|
||||||
|
# https://gfee_li.artstation.com/projects/XPGOD
|
||||||
|
# https://gfee_li.artstation.com/projects/asuka-7
|
||||||
|
when %r{\Ahttps?://\w+\.artstation.com/(?:artwork|projects)/(?<project_id>[a-z0-9-]+)\z/}i
|
||||||
|
"https://www.artstation.com/artwork/#{$~[:project_id]}"
|
||||||
|
|
||||||
when %r{\Ahttps?://(?:o|image-proxy-origin)\.twimg\.com/\d/proxy\.jpg\?t=(\w+)&}i
|
when %r{\Ahttps?://(?:o|image-proxy-origin)\.twimg\.com/\d/proxy\.jpg\?t=(\w+)&}i
|
||||||
str = Base64.decode64($1)
|
str = Base64.decode64($1)
|
||||||
url = URI.extract(str, ['http', 'https'])
|
url = URI.extract(str, ['http', 'https'])
|
||||||
|
|||||||
Reference in New Issue
Block a user