mirror of
https://github.com/iv-org/invidious.git
synced 2026-09-06 17:12:45 -05:00
Implement fallback for empty author_id
Add logic to extract channel ID for collaboration videos with empty author ID.
This commit is contained in:
parent
9d1291a0b8
commit
e2c83e8fd7
@ -84,6 +84,15 @@ private module Parsers
|
|||||||
author_id = author_fallback.id
|
author_id = author_fallback.id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# When ucid is still empty (e.g. collaboration videos with a composite
|
||||||
|
# channel name and no navigation endpoint), extract the first creator's
|
||||||
|
# channel ID from the channelThumbnailSupportedRenderers navigationEndpoint.
|
||||||
|
if author_id.empty?
|
||||||
|
if channel_id = item_contents.dig?("channelThumbnailSupportedRenderers", "channelThumbnailWithLinkRenderer", "navigationEndpoint", "browseEndpoint", "browseId").try &.as_s
|
||||||
|
author_id = channel_id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
author_thumbnail = item_contents.dig?("channelThumbnailSupportedRenderers", "channelThumbnailWithLinkRenderer", "thumbnail", "thumbnails", 0, "url").try &.as_s
|
author_thumbnail = item_contents.dig?("channelThumbnailSupportedRenderers", "channelThumbnailWithLinkRenderer", "thumbnail", "thumbnails", 0, "url").try &.as_s
|
||||||
|
|
||||||
author_verified = has_verified_badge?(item_contents["ownerBadges"]?)
|
author_verified = has_verified_badge?(item_contents["ownerBadges"]?)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user