How to Automatically Unlock Password Protected Videos for Specific Users?

Hello PeerTube community. This is my first post on this forum, so please be kind to me. I have tried to follow all the guidelines.

My Question

Is it possible to automatically unlock password protected videos for specific users on PeerTube (is such logic implemented and how can I use it)? If not, what would be the best approach to achieve such functionality?

Some Background

Since PeerTube v6 it is possible to password protect videos. This is a great feature and I want to make a business model out of it in the sense that I want to make some premium content available to some users before everyone gets it a week later. I know that I can set as many video passwords as I want using the REST API. This allows me to deauthenticate non-paying accounts by setting and updating video passwords on a per-user basis. I also know there’s the embed API, but I’m not entirely sure if that’s necessary if I’m not embedding, but using my PeerTube instance directly.

With all that said, let me get back to my question: With video passwords set via the REST API, how can I automatically unlock videos for specific users? In other words, can I automatically share video passwords with users?



Only moderators can access password protected videos without the password. So I think the best way to handle your use case is to use the REST API and the Embed API. You can also try to develop a plugin, I know there are some of them trying to deal with premium content like (but I have not tested it).

1 Like

Thanks for your reply. I checked out the plugin. However, I am not quite sure how to manage premium (password protected) videos within PeerTube. My follow-up questions are:

  1. How is a password protected video displayed to users before they enter the video password? Are the thumbnail, title and description visible? Are they blurred?
  2. How is the embed API used within the PeerTube instance interface? Is the embed API part of a default PeerTube instance?

They are not visible

Yes, it’s part of PeerTube. See: PeerTube Embed API | PeerTube documentation