peertube-plugin-peeryou (0.1.1)
Installation
registry=npm install peertube-plugin-peeryou@0.1.1"peertube-plugin-peeryou": "0.1.1"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,
- emails you (and shows an in-app notification) with a direct YouTube Studio link so you can flip it to Public in one click.
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/peertube-plugin-peeryou/router/auth/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.0.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 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). |
| Notification email | Receives the "flip to Public" email (leave empty to disable email). |
| Google OAuth client ID / secret | From your Google Cloud project. |
Then connect your YouTube channel by visiting:
https://<your-instance>/plugins/peertube-plugin-peeryou/router/auth
(admin only). You will be redirected to Google for consent. After connecting, the plugin shows the connected channel.
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, open the backfill page (admin only):
https://<your-instance>/plugins/peertube-plugin-peeryou/router/backfill
Tick the videos you want and click Schedule selected to YouTube.
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 (email with a YouTube Studio action button + 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 by revisiting the
/router/authpage. - Registry install fails: the package name must be exactly
peertube-plugin-peeryou. If you get a 401/403, the PeerTube server's package manager isn't configured for the Forgejo registry — check the.npmrcdescribed in "Install" (registry URL +_authTokenwithread: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 |