#1866: support wikia source redirection
included support for different image servers
This commit is contained in:
@@ -326,7 +326,12 @@ class Post < ActiveRecord::Base
|
||||
|
||||
when %r{\Ahttp://(?:(?:s?img|cdn|www)\d?\.)?gelbooru\.com/{1,2}(?:images|samples)/\d+/(?:sample_)?([a-f0-9]{32})\.}i
|
||||
"http://gelbooru.com/index.php?page=post&s=list&md5=#{$1}"
|
||||
|
||||
|
||||
when %r{\Ahttps?://(?:slot\d*\.)?im(?:g|ages)\d*\.wikia\.nocookie\.net/(?:_{2}cb\d{14}/)?([^/]+)/images/(?:(?:thumb|archive)?/)?[a-f0-9]/[a-f0-9]{2}/([^/]+)}i
|
||||
subdomain = $1
|
||||
filename = $2
|
||||
"http://#{subdomain}.wikia.com/wiki/File:#{filename}"
|
||||
|
||||
else
|
||||
source
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user