sources: parse more profile url formats.
Add support for parsing these URL formats: * https://www.artstation.com/felipecartin/profile * https://www.deviantart.com/nlpsllp/gallery * https://fantia.jp/asanagi * https://www.lofter.com/front/blog/home-page/noshiqian * https://www.lofter.com/app/xiaokonggedmx * https://www.lofter.com/blog/semblance * https://q.nicovideo.jp/users/18700356 * https://dic.nicovideo.jp/u/11141663 * https://3d.nicovideo.jp/users/109584 * https://3d.nicovideo.jp/u/siobi * https://game.nicovideo.jp/atsumaru/users/7757217 * https://www.pixiv.net/user/13569921/series/81967 * https://pixiv.cc/zerousagi/ * https://www.plurk.com/u/ddks2923 * https://www.plurk.com/m/u/leiy1225 * https://www.plurk.com/s/u/salmonroe13 * https://www.plurk.com/RSSSww/invite/4 * https://skeb.jp/@okku_oxn/works * https://www.tumblr.com/blog/view/artofelaineho/187614935612 * https://www.tumblr.com/blog/view/artofelaineho * https://www.tumblr.com/blog/artofelaineho * https://www.tumblr.com/dashboard/blog/dankwartart * https://rosarrie.tumblr.com/archive * https://whereisnovember.tumblr.com/tagged/art * https://twitpic.com/photos/Type10TK * https://www.weibo.com/detail/4676597657371957 * https://www.weibo.com/u/5957640693/home?wvr=5 * https://www.weibo.com/lvxiuzi0/home
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Unparsed:
|
||||
# https://fantia.jp/asanagi
|
||||
# Unhandled:
|
||||
#
|
||||
# https://fantia.jp/commissions/64988
|
||||
# https://fantia.jp/profiles/tus_2n9n0fm05fizg
|
||||
|
||||
class Source::URL::Fantia < Source::URL
|
||||
attr_reader :full_image_url
|
||||
@@ -56,6 +58,11 @@ class Source::URL::Fantia < Source::URL
|
||||
in _, "fanclubs", /\d+/ => fanclub_id, *rest
|
||||
@fanclub_id = fanclub_id
|
||||
|
||||
# https://fantia.jp/asanagi
|
||||
# https://fantia.jp/koruri
|
||||
in _, username
|
||||
@username = username
|
||||
|
||||
else
|
||||
end
|
||||
end
|
||||
@@ -77,7 +84,11 @@ class Source::URL::Fantia < Source::URL
|
||||
end
|
||||
|
||||
def profile_url
|
||||
"https://fantia.jp/fanclubs/#{fanclub_id}" if fanclub_id.present?
|
||||
if fanclub_id.present?
|
||||
"https://fantia.jp/fanclubs/#{fanclub_id}"
|
||||
elsif username.present?
|
||||
"https://fantia.jp/#{username}"
|
||||
end
|
||||
end
|
||||
|
||||
def work_id
|
||||
|
||||
Reference in New Issue
Block a user