mirror of
https://github.com/iv-org/invidious.git
synced 2025-04-11 18:49:09 -04:00
Parse members only badges of videos
This commit is contained in:
parent
409d12a81e
commit
e1b2eb2a7b
@ -9,6 +9,7 @@ enum VideoBadges
|
||||
VR180
|
||||
VR360
|
||||
ClosedCaptions
|
||||
MembersOnly
|
||||
end
|
||||
|
||||
struct SearchVideo
|
||||
@ -133,6 +134,7 @@ struct SearchVideo
|
||||
json.field "isVr360", self.badges.vr360?
|
||||
json.field "is3d", self.badges.three_d?
|
||||
json.field "hasCaptions", self.badges.closed_captions?
|
||||
json.field "isMembersOnly", self.badges.members_only?
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -135,6 +135,10 @@ private module Parsers
|
||||
when "Premium"
|
||||
# TODO: Potentially available as item_contents["topStandaloneBadge"]["metadataBadgeRenderer"]
|
||||
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
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user