artist_url.rb: remove unnecessary deviantart profile url normalization.

This is now handled in the source strategy.
This commit is contained in:
evazion
2018-09-07 12:26:50 -05:00
parent a67edb8783
commit 8e7dd9e97f

View File

@@ -25,9 +25,6 @@ class ArtistUrl < ApplicationRecord
url = url.sub(%r!^http://blog-imgs-\d+-\w+\.fc2!, "http://blog.fc2")
# url = url.sub(%r!^(http://seiga.nicovideo.jp/user/illust/\d+)\?.+!, '\1/')
url = url.sub(%r!^http://pictures.hentai-foundry.com//!, "http://pictures.hentai-foundry.com/")
if url !~ %r{\Ahttps?://(?:fc|th|pre|orig|img|www)\.}
url = url.sub(%r{\Ahttps?://(.+?)\.deviantart\.com(.*)}, 'http://www.deviantart.com/\1\2')
end
# the strategy won't always work for twitter because it looks for a status
url = url.downcase if url =~ %r!^https?://(?:mobile\.)?twitter\.com!
@@ -74,9 +71,6 @@ class ArtistUrl < ApplicationRecord
url = url.gsub(%r!^http://blog-imgs-\d+-\w+\.fc2!, "http://blog*.fc2")
url = url.gsub(%r!^http://img\d+\.pixiv\.net!, "http://img*.pixiv.net")
url = url.gsub(%r!^http://i\d+\.pixiv\.net/img\d+!, "http://*.pixiv.net/img*")
if url !~ %r{\Ahttps?://(?:fc|th|pre|orig|img|www)\.}
url = url.sub(%r{\Ahttps?://(.+?)\.deviantart\.com(.*)}, "http://www.deviantart.com/#\1\2")
end
url
end