mirror of
				https://github.com/iv-org/invidious.git
				synced 2025-10-31 20:51:56 +00:00 
			
		
		
		
	Fix detection of premium content
This commit is contained in:
		| @@ -803,8 +803,11 @@ struct Video | ||||
|   end | ||||
|  | ||||
|   def premium | ||||
|     premium = self.player_response.to_s.includes? "Get YouTube without the ads." | ||||
|     return premium | ||||
|     if info["premium"]? | ||||
|       self.info["premium"] == "true" | ||||
|     else | ||||
|       false | ||||
|     end | ||||
|   end | ||||
|  | ||||
|   def captions | ||||
| @@ -1189,6 +1192,8 @@ def fetch_video(id, region) | ||||
|   author = player_json["videoDetails"]["author"]?.try &.as_s || "" | ||||
|   ucid = player_json["videoDetails"]["channelId"]?.try &.as_s || "" | ||||
|  | ||||
|   info["premium"] = html.xpath_node(%q(.//span[text()="Premium"])) ? "true" : "false" | ||||
|  | ||||
|   views = html.xpath_node(%q(//meta[@itemprop="interactionCount"])) | ||||
|     .try &.["content"].to_i64? || 0_i64 | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Omar Roth
					Omar Roth