Also check out a companion UI extension! SillyTavern-YouTube-Videos-UI
Server plugin to extract a direct URL to a YouTube video using the yt-dlp library.
Tip
Both endpoints also support providing the URL as a query parameter.
Send a message containing a video element with the source URL pre-wrapped with /api/plugins/youtube/play/.
For example
<video src="/api/plugins/youtube/play/https://youtu.be/zFfL0y3zyfc" autoplay controls></video>Query the GET /api/plugins/youtube/info/ endpoint to fetch the video info.
interface VideoInfo {
id: string;
title: string;
url: string;
thumbnail: string;
duration: number;
description: string;
uploader: string;
view_count: number;
upload_date: string;
}Example: GET /api/plugins/youtube/info/https://youtu.be/zFfL0y3zyfc.
-
Before you begin, make sure you set a config
enableServerPluginstotruein the config.yaml file of SillyTavern. -
Open a terminal in your SillyTavern directory, then run the following:
cd plugins
git clone https://github.com/SillyTavern/SillyTavern-YouTube-Videos-Server- Restart the SillyTavern server. The yt-dlp binary will be automatically downloaded from GitHub when you start the first video.
Clone the repository, then run npm install.
# Debug build
npm run build:dev
# Prod build
npm run buildAGPLv3