#1866: support e-shuushuu source redirection
* currently, e-shuushuu already redirects some posts to their landing pages (http://e-shuushuu.net/image/?image_id=$id), particularly those ending in 'jpg' * for some reason, e-shuushuu doesn't natively support other formats even the uppercased 'JPG' * the following lines aim to address this issue to redirect to http://e-shuushuu.net/image/$id * http://e-shuushuu.net/image.php?mode=view&image_id=$id is also a valid alternative but is not used
This commit is contained in:
@@ -337,6 +337,9 @@ class Post < ActiveRecord::Base
|
|||||||
filename = $2
|
filename = $2
|
||||||
"http://g.e-hentai.org/?f_shash=#{sha1hash}&fs_from=#{filename}"
|
"http://g.e-hentai.org/?f_shash=#{sha1hash}&fs_from=#{filename}"
|
||||||
|
|
||||||
|
when %r{\Ahttp://e-shuushuu.net/images/\d{4}-(?:\d{2}-){2}(\d+)}i
|
||||||
|
"http://e-shuushuu.net/image/#{$1}"
|
||||||
|
|
||||||
else
|
else
|
||||||
source
|
source
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user