pixiv: normalize new profile urls.

ref: https://danbooru.donmai.us/forum_topics/9127?page=290#forum_post_162222
This commit is contained in:
evazion
2020-01-08 16:11:48 -06:00
parent ba2744ad42
commit 5a4b24f6a0
3 changed files with 11 additions and 0 deletions

View File

@@ -27,6 +27,9 @@ class ArtistUrl < ApplicationRecord
# 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/")
# XXX should be handled by pixiv strategy.
url = url.sub(%r!\Ahttps?://www\.pixiv\.net/(?:en/)?users/(\d+)\z!i, 'https://www.pixiv.net/member.php?id=\1')
# the strategy won't always work for twitter because it looks for a status
url = url.downcase if url =~ %r!^https?://(?:mobile\.)?twitter\.com!