peertube-plugin-peeryou (1.2.0)
Installation
registry=npm install peertube-plugin-peeryou@1.2.0"peertube-plugin-peeryou": "1.2.0"About this package
Peer You!
Automatically upload videos published on your PeerTube instance to your YouTube channel after a configurable delay.
Each PeerTube user connects their own YouTube channel from their account page (Settings → YouTube sync, or /my-account/p/peeryou). A user's published videos sync to their own channel; users who haven't connected are skipped.
The 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 waits the full configured delay, uploads the video as Private, and shows an in-app notification with the YouTube video id so you can flip it to Public in YouTube Studio.
Users cannot connect until the instance admin adds their Google accounts as Test users on the Google OAuth app. While the app is in Testing mode, the consent screen only accepts accounts listed under Audience → Test users; a rejected user gets no error message in the plugin. (Alternatively, publish the OAuth app to Production to allow any Google account to grant consent — Google then reviews the app, which is not required for personal use.)
Prerequisites
- PeerTube >= 8.2.4 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 for every PeerTube user who will connect a channel — otherwise the consent step rejects them.
- 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). This redirect URI is derived from your instance's public URL, so it must match exactly — 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 plugin is published on npm and appears in the PeerTube plugin index, so it installs like any other PeerTube plugin.
In the PeerTube admin panel, go to Plugins → Install plugin, search for peertube-plugin-peeryou, and click Install.
Or, from the PeerTube CLI (see https://docs.joinpeertube.org/use/cli):
peertube-cli auth add -u '<your-instance>' -U '<user>'
peertube-cli plugins install -n peertube-plugin-peeryou
Once installed, the admin sets the global settings (below) and each user connects their own YouTube channel.
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. |
Per-user YouTube sync
Each user controls their sync from Settings → YouTube sync (/my-account/p/peeryou):
- Connection: connect their own YouTube channel (OAuth), view the connected channel, or disconnect.
- Settings: per-user overrides for Delay (days), Description suffix, and Minimum privacy. Leave a field empty to use the instance default.
- Backfill: list the user's own published eligible videos and sync selected ones immediately.
Usage
- Every new video published on PeerTube (meeting the privacy setting) is queued for the video owner's YouTube channel.
- 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 the video owner to publish it in YouTube Studio.
- To sync already-published videos right away, use the Backfill section on the YouTube sync page: tick the videos you want and click Sync selected videos now.
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).
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 on the YouTube sync page (Settings → YouTube sync).
- Consent screen rejects a user: the user's Google account isn't listed under the OAuth app's Audience → Test users (see Prerequisites).
Security and trust
Connecting a YouTube channel gives the plugin a long-lived Google OAuth token, stored on the PeerTube server so the plugin can upload after the configured delay. Because the token lives on the server, users must trust their instance admin not to misuse it — the admin can read the stored token or modify the plugin code. The token only grants access to the connected YouTube channel (the scopes are limited to youtube.upload and youtube.readonly): it can upload, edit, or delete videos on that channel, but nothing outside it — no email, Drive, or other Google services.
The Disconnect button only removes the token from the server; it does not revoke a copy the admin may have already taken. A user who wants to fully revoke access can do so from their Google account (Security → Third-party apps with account access), which invalidates the token at Google regardless of what the server holds.
This trust model is inherent to any server-side "upload on my behalf after a delay" design and is worth being aware of before connecting a channel.
Source
Source code and issues: https://git.sync.wtf/troed/peeryou
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 |