mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Readd paid attribute for videos (#2330)
This commit is contained in:
parent
c06a20e085
commit
25362f16a0
1 changed files with 7 additions and 0 deletions
|
@ -301,6 +301,7 @@ struct Video
|
|||
json.field "likeCount", self.likes
|
||||
json.field "dislikeCount", self.dislikes
|
||||
|
||||
json.field "paid", self.paid
|
||||
json.field "premium", self.premium
|
||||
json.field "isFamilyFriendly", self.is_family_friendly
|
||||
json.field "allowedRegions", self.allowed_regions
|
||||
|
@ -688,6 +689,12 @@ struct Video
|
|||
items
|
||||
end
|
||||
|
||||
def paid
|
||||
reason = info["playabilityStatus"]?.try &.["reason"]?
|
||||
paid = reason == "This video requires payment to watch." ? true : false
|
||||
paid
|
||||
end
|
||||
|
||||
def premium
|
||||
keywords.includes? "YouTube Red"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue