mirror of
https://github.com/iv-org/invidious.git
synced 2025-06-30 10:38:29 +00:00
Parse members only badges of videos
This commit is contained in:
parent
409d12a81e
commit
e1b2eb2a7b
@ -9,6 +9,7 @@ enum VideoBadges
|
|||||||
VR180
|
VR180
|
||||||
VR360
|
VR360
|
||||||
ClosedCaptions
|
ClosedCaptions
|
||||||
|
MembersOnly
|
||||||
end
|
end
|
||||||
|
|
||||||
struct SearchVideo
|
struct SearchVideo
|
||||||
@ -133,6 +134,7 @@ struct SearchVideo
|
|||||||
json.field "isVr360", self.badges.vr360?
|
json.field "isVr360", self.badges.vr360?
|
||||||
json.field "is3d", self.badges.three_d?
|
json.field "is3d", self.badges.three_d?
|
||||||
json.field "hasCaptions", self.badges.closed_captions?
|
json.field "hasCaptions", self.badges.closed_captions?
|
||||||
|
json.field "isMembersOnly", self.badges.members_only?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -135,6 +135,10 @@ private module Parsers
|
|||||||
when "Premium"
|
when "Premium"
|
||||||
# TODO: Potentially available as item_contents["topStandaloneBadge"]["metadataBadgeRenderer"]
|
# TODO: Potentially available as item_contents["topStandaloneBadge"]["metadataBadgeRenderer"]
|
||||||
badges |= VideoBadges::Premium
|
badges |= VideoBadges::Premium
|
||||||
|
when "Members only"
|
||||||
|
# TODO: Identify based on style attribute instead of label
|
||||||
|
# It should be more resistant to Youtube changes.
|
||||||
|
badges |= VideoBadges::MembersOnly
|
||||||
else nil # Ignore
|
else nil # Ignore
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user