weibo: fix https://m.weibo.cn/detail/1234 urls not finding the artist.
Fix https://m.weibo.cn/detail/4506950043618873 type URLs not finding the artist because the profile_url method returned nil instead of the actual profile URL.
This commit is contained in:
@@ -53,13 +53,17 @@ module Sources
|
||||
end
|
||||
|
||||
def profile_url
|
||||
profile_urls.first
|
||||
"https://www.weibo.com/u/#{artist_id}" if artist_id.present?
|
||||
end
|
||||
|
||||
def artist_name
|
||||
api_response&.dig("user", "screen_name")
|
||||
end
|
||||
|
||||
def artist_id
|
||||
parsed_url.artist_short_id || parsed_referer&.artist_short_id || api_response&.dig("user", "id")
|
||||
end
|
||||
|
||||
def artist_commentary_desc
|
||||
return if api_response.blank?
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@ module Sources
|
||||
|
||||
assert_equal("https://www.weibo.com/5501756072/J2UNKfbqV", @site.page_url)
|
||||
assert_equal("https://www.weibo.com/5501756072/J2UNKfbqV", @site.canonical_url)
|
||||
assert_equal("https://www.weibo.com/u/5501756072", @site.profile_url)
|
||||
assert_equal(%w[fgo Alter组], @site.tags.map(&:first))
|
||||
assert_equal("阿尔托莉雅厨", @site.artist_name)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user