From edd02c4019149b3fa60b3dfda7f2713368578ca5 Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 6 Jun 2017 13:08:06 -0500 Subject: [PATCH] artstation: normalize to www.artstation.com/artwork/$id for sidebar. --- app/models/post.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/post.rb b/app/models/post.rb index 2e49b9384..6cc0b6477 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -528,6 +528,11 @@ class Post < ActiveRecord::Base # https://yande.re/sample/ceb6a12e87945413a95b90fada406f91/.jpg when %r{\Ahttps?://(?:ayase\.|yuno\.|files\.)?yande\.re/(?:image|jpeg|sample)/(?[a-z0-9]{32})(?:/yande\.re.*|/?\.(?:jpg|png))\Z}i "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)/(?[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 str = Base64.decode64($1)