fix normalization for nico seiga urls
This commit is contained in:
@@ -13,7 +13,7 @@ class ArtistUrl < ActiveRecord::Base
|
||||
url = url.gsub(/^http:\/\/blog\d+\.fc2/, "http://blog.fc2")
|
||||
url = url.gsub(/^http:\/\/blog-imgs-\d+\.fc2/, "http://blog.fc2")
|
||||
url = url.gsub(/^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://seiga.nicovideo.jp/user/illust/\d+)\?.+!, '\1/')
|
||||
url = url.sub(%r!^http://pictures.hentai-foundry.com//!, "http://pictures.hentai-foundry.com/")
|
||||
begin
|
||||
url = Sources::Site.new(url).normalize_for_artist_finder!
|
||||
|
||||
@@ -5,7 +5,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'config',
|
||||
ActiveRecord::Base.without_timeout do
|
||||
ArtistUrl.where("normalized_url like ?", "\%nico\%").find_each do |url|
|
||||
before = url.normalized_url
|
||||
url.normalized_url = Sources::Site.new(before).normalize_for_artist_finder!
|
||||
url.normalize!
|
||||
puts "#{before} -> #{url.normalized_url}" if before != url.normalized_url
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user