#1866 update for new deviantart urls

This commit is contained in:
Toks
2015-03-13 14:12:17 -04:00
parent 097914ca67
commit 04e6aa7474
3 changed files with 13 additions and 9 deletions

View File

@@ -324,10 +324,10 @@ class Post < ActiveRecord::Base
base_36_id = base_10_id.to_s(36)
"http://twitpic.com/#{base_36_id}"
when %r{\Ahttps?://(?:fc|th)\d{2}\.deviantart\.net/.+/[a-z0-9_]*_by_([a-z0-9_]+)-d([a-z0-9]+)\.}i
when %r{\Ahttps?://(?:fc|th|pre|orig|img)\d{2}\.deviantart\.net/.+/[a-z0-9_]*_by_([a-z0-9_]+)-d([a-z0-9]+)\.}i
"http://#{$1}.deviantart.com/gallery/#/d#{$2}"
when %r{\Ahttps?://(?:fc|th)\d{2}\.deviantart\.net/.+/[a-f0-9]+-d([a-z0-9]+)\.}i
when %r{\Ahttps?://(?:fc|th|pre|orig|img)\d{2}\.deviantart\.net/.+/[a-f0-9]+-d([a-z0-9]+)\.}i
"http://deviantart.com/gallery/#/d#{$1}"
when %r{\Ahttp://www\.karabako\.net/images(?:ub)?/karabako_(\d+)(?:_\d+)?\.}i