peertube-plugin-peeryou (0.1.11)
Installation
registry=npm install peertube-plugin-peeryou@0.1.11"peertube-plugin-peeryou": "0.1.11"About this package
Peer You!
Automatically upload videos published on your PeerTube instance to your YouTube channel after a configurable delay.
Important: This plugin does NOT pursue Google's YouTube Data API compliance audit. Because of that, YouTube locks uploads to Private and ignores scheduled publishing. The plugin therefore:
- waits the full configured delay,
- uploads the video to YouTube as Private,
- shows an in-app notification with the YouTube video id so you can flip it to Public in YouTube Studio.
Prerequisites
- PeerTube >= 8.3 on a server you administer.
- A YouTube channel that you own and want to publish to.
The remaining prerequisites are a Google Cloud project — a free developer workspace, separate from your YouTube account, that lets software use Google APIs. Set it up once:
-
Create a Google Cloud project. Go to https://console.cloud.google.com, click the project dropdown (top-left) → New Project, and give it a name (e.g.
peeryou). -
Enable the YouTube Data API v3. Inside that project, go to https://console.cloud.google.com/apis/library/youtube.googleapis.com and click Enable.
-
Create an OAuth 2.0 Web client — the credential the plugin uses to upload on your behalf:
- Go to APIs & Services → OAuth consent screen, choose External, and fill in an app name and your email.
- Because YouTube scopes are sensitive, the app starts in Testing mode. Under Audience → Test users, add the Google account that owns your YouTube channel — otherwise the consent step rejects you.
- Go to APIs & Services → Credentials → Create Credentials → OAuth client ID, choose Web application, and under Authorized redirect URIs add exactly:
https://<your-instance>/plugins/peeryou/router/callbackReplace
<your-instance>with your actual PeerTube domain (e.g.https://videos.example.com). The full URL must match what is set in the PeerTube plugin settings when you connect — a mismatch is the most common cause of connection failures.- Copy the Client ID and Client secret it returns; you will paste them into the plugin's Google OAuth client ID / secret settings.
The YouTube account you connect must own the target channel. Google shows an "unverified app" warning during consent — expected and harmless for personal use.
Install
The package is published to the npm registry of this repository's Forgejo instance (https://git.sync.wtf/api/packages/troed/npm/). PeerTube installs name-based plugins by running its package manager (pnpm) against the registry configured for it — which defaults to npmjs.org. Point it at the Forgejo registry by adding a .npmrc for the user running PeerTube (or in PeerTube's plugins storage directory):
registry=https://git.sync.wtf/api/packages/troed/npm/
//git.sync.wtf/api/packages/troed/npm/:_authToken=<owner-token>
<owner-token> is a token for the troed account with read:package scope, created in Settings → Applications → Generate New Token (not the OWNER_TOKEN repo secret used for publishing). With that in place, install directly:
peertube-cli plugins install -n peertube-plugin-peeryou --plugin-version 0.1.1
(requires the PeerTube CLI, see https://docs.joinpeertube.org/use/cli and peertube-cli auth add -u '<your-instance>' -U '<user>')
Alternatively, in the PeerTube admin panel go to Plugins → Install plugin, enter the npm package name peertube-plugin-peeryou (and optionally a specific version), and install.
The registry install only works if PeerTube's plugins storage directory doesn't already contain other plugins. When you point
registryat the Forgejo registry,pnpmre-resolves every plugin already in the plugins directory against it — so any pre-existing plugins installed from npmjs.org will 404 and the whole install fails. If your server already has plugins (the common case), use the path-based install below instead.
Installing on a server that already has plugins
Download the package tarball on the PeerTube server and install it from a local path. This works regardless of which registry other plugins came from.
# in the PeerTube container (or on the server host, adapting paths to your setup)
cd /tmp
curl -L -o peeryou.tgz https://git.sync.wtf/api/packages/troed/npm/peertube-plugin-peeryou/-/0.1.1/peertube-plugin-peeryou-0.1.1.tgz
mkdir -p peertube-plugin-peeryou
tar -xzf peeryou.tgz -C peertube-plugin-peeryou --strip-components=1
chown -R peertube:peertube /tmp/peertube-plugin-peeryou
# the directory name must be exactly "peertube-plugin-peeryou" (PeerTube derives
# the plugin name from the path), and the file must be readable by the PeerTube user
peertube-cli plugins install --path /tmp/peertube-plugin-peeryou
If you run PeerTube in Docker, run these commands inside the container (docker compose exec peertube sh) and make sure the extracted directory is readable by the peertube user (UID 999).
The npm registry install requires the PeerTube instance to reach
https://git.sync.wtf. The admin-panel "install from a plugin path" option also still works if you prefer to install from a local copy of the repository (see "Publishing a new release" below for how the package is produced).
Configure
In the PeerTube admin plugin settings:
| Setting | Meaning |
|---|---|
| Delay (days) | Days between PeerTube publication and the YouTube upload (default 7). |
| Description suffix | Text appended to the YouTube description; {videoUrl} is replaced with the PeerTube link. |
| Minimum PeerTube privacy | Public only or Public + Unlisted. |
| Check interval (minutes) | How often the plugin checks for due uploads (default 5). |
| Google OAuth client ID / secret | From your Google Cloud project. |
The plugin settings page also shows a YouTube connection section:
- Not connected: a Connect to YouTube button opens Google's consent screen and returns to the settings page showing the connected channel.
- Connected: the channel name is displayed.
(admin only — the controls render only for admins.)
Publishing a new release
Releases are published automatically by a Forgejo Actions workflow when you push a tag with a semantic version (vX.Y.Z):
# 1. bump the version in package.json
# 2. commit
git commit -am "release: v0.0.1"
git tag v0.0.1
git push && git push --tags
The workflow runs npm ci, npm test and npm run build, verifies that the tag version matches package.json's version, then publishes to:
https://git.sync.wtf/troed/-/packages/npm/peertube-plugin-peeryou
To publish, the repository needs a secret named OWNER_TOKEN: a personal access token for the troed account with the write:package scope. Create it in the repo's Settings → Actions → Secrets, using your own user token (NOT the built-in GITHUB_TOKEN/FORGEJO_TOKEN, which the registry refuses).
If the workflow fails, check the run log: a version mismatch fails the job before publishing, and re-pushing an already-published version fails with a registry conflict (bump the version and re-tag).
Usage
- Every new video published on PeerTube (meeting the privacy setting) is queued for YouTube.
- On the upload/update form, untick "Sync to YouTube" to exclude a specific video.
- When the delay elapses, the plugin uploads the video as Private and notifies you to publish it in YouTube Studio.
- To schedule already-published videos, use the Backfill existing videos section on the same plugin settings page: tick the videos you want and click Schedule selected to YouTube. They are queued with the current time as their upload date, so they upload on the next scheduler run.
How it works
- The plugin listens to PeerTube's
action:api.video.uploaded/action:api.video.updatedhooks. - Eligible videos (local, published, meeting the privacy threshold, not opted out) are queued with
uploadAt = publishedAt + delay. - A periodic timer uploads due videos to YouTube via the Data API v3 (
videos.insertasprivate, thenthumbnails.set), carrying over title, description (+ suffix), tags, category, licence, and thumbnail. - On success you are notified with an in-app notification.
- Failed uploads are logged and dropped (no retries, best-effort).
Backfill page behavior
The backfill page lists published local videos via the public PeerTube API, filtered to the configured privacy threshold. Only videos that have not already been processed are meant to be selected.
Troubleshooting
- Video never appears on YouTube: check the PeerTube logs for
peeryou:entries. Common causes: not connected (no tokens), video was not eligible (privacy/published state), or no local web video file (remote/object storage). - Upload fails with
youtube 403: the OAuth scope may be missingyoutube.upload, or the connected account lacks upload rights on the target channel. - Token refresh fails: reconnect via the Connect to YouTube button in the plugin settings page.
- Registry install fails with
404or400: the most likely cause is that the plugins storage directory already contains plugins installed from npmjs.org — withregistrypointed at the Forgejo registry,pnpmre-resolves those against Forgejo and they 404, failing the whole install. Use the path-based install (see "Installing on a server that already has plugins") instead. If you get a 401/403 instead, the server's package manager isn't authenticated for the Forgejo registry — check the_authTokenin the.npmrcdescribed in "Install" (read:packagescope) and that the server can reachhttps://git.sync.wtf.
Dependencies
Dependencies
| ID | Version |
|---|---|
| googleapis | ^174.0.1 |
Development dependencies
| ID | Version |
|---|---|
| @peertube/peertube-types | ^8.2.4 |
| esbuild | ^0.28.1 |
| express | ^5.2.1 |
| jest | ^30.4.2 |
| supertest | ^7.2.2 |