Fix Pixiv user profile URL to use the latest format

This will only affect new artist and commentary records going forward.
This commit is contained in:
BrokenEagle
2020-06-17 06:22:29 +00:00
parent 05f9b78ee3
commit 158a4aa916
2 changed files with 6 additions and 6 deletions

View File

@@ -80,7 +80,7 @@ module Sources
text = text.gsub(%r{https?://www\.pixiv\.net/member\.php\?id=([0-9]+)}i) do |_match|
member_id = $1
profile_url = "https://www.pixiv.net/member.php?id=#{member_id}"
profile_url = "https://www.pixiv.net/users/#{member_id}"
search_params = {"search[url_matches]" => profile_url}.to_param
%("user/#{member_id}":[#{profile_url}] "»":[/artists?#{search_params}])
@@ -155,7 +155,7 @@ module Sources
end
end
"https://www.pixiv.net/member.php?id=#{metadata.user_id}"
"https://www.pixiv.net/users/#{metadata.user_id}"
rescue PixivApiClient::BadIDError
nil
end