pixiv: normalize new profile urls.
ref: https://danbooru.donmai.us/forum_topics/9127?page=290#forum_post_162222
This commit is contained in:
@@ -109,6 +109,8 @@ class Artist < ApplicationRecord
|
||||
"pixiv.cc", # http://pixiv.cc/0123456789/
|
||||
"pixiv.net", # https://www.pixiv.net/member.php?id=10442390
|
||||
"pixiv.net/stacc", # https://www.pixiv.net/stacc/aaaninja2013
|
||||
"pixiv.net/users", # https://www.pixiv.net/users/555603
|
||||
"pixiv.net/en/users", # https://www.pixiv.net/en/users/555603
|
||||
"i.pximg.net",
|
||||
"plurk.com", # http://www.plurk.com/a1amorea1a1
|
||||
"privatter.net",
|
||||
|
||||
@@ -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!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user