Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support adding custom video privacy #6299

Open
kontrollanten opened this issue Mar 28, 2024 · 0 comments
Open

Support adding custom video privacy #6299

kontrollanten opened this issue Mar 28, 2024 · 0 comments
Labels
Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development Type: Feature Request ✨

Comments

@kontrollanten
Copy link
Contributor

Describe the current behavior

No response

Steps to reproduce

  1. Create a plugin with a custom video privacy: videoPrivacyManager.addConstant(544, 'Super secret')
  2. Apply the privacy to a video
  3. Fetch the video
  4. See a HTTP 500 with error Unknown video privacy 544 to know if the video requires auth

Describe the expected behavior

Extend the video privacy API like:

videoPrivacyManager.addPrivacy(544, 'Super secret', (user, video) => {
  if (user.id === 1) return true;

  return false;
})

Or a solution that would fit our case much better:

videoPrivacyManager.addPrivacy(544, 'Super secret', (user, video) => {
  if (user.id === 1) return video;

  const replacementVideo = peertubeHelpers.videos.loadByUrl(FIXED_URL_TO_A_REPLACEMENT_VIDEO);

  return replacementVideo;
})

In the latter case the plugin author can choose to return another video, but I assume this won't fit into the current structure. The same functionality would be possible to solve by using a filter hook.

Additional information

  • PeerTube instance:

    • URL:
    • Version: 6.0.3
    • NodeJS version:
    • Ffmpeg version:
  • Browser name, version and platforms on which you could reproduce the bug:

  • Link to browser console log if relevant:

  • Link to server log if relevant (journalctl or /var/www/peertube/storage/logs/):

@Chocobozzz Chocobozzz changed the title Adding custom video privacies is breaking the authorization Support adding custom video privacy Mar 28, 2024
@Chocobozzz Chocobozzz added Type: Feature Request ✨ Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development labels Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: PeerTube Plugin 📦 Features that can be developed in a plugin, but require PeerTube plugin API development Type: Feature Request ✨
Projects
None yet
Development

No branches or pull requests

2 participants