From 1f8ac02436237f0a4f2f10b8c37b28578cc5a411 Mon Sep 17 00:00:00 2001 From: Florent F Date: Thu, 1 Aug 2019 10:41:00 +0200 Subject: [PATCH] Document how to synchronize YT channel to PeerTube --- support/doc/tools.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/support/doc/tools.md b/support/doc/tools.md index f0d3b15b2..e0f02173e 100644 --- a/support/doc/tools.md +++ b/support/doc/tools.md @@ -2,7 +2,7 @@ -**Table of Contents** +**Table of Contents** - [Remote Tools](#remote-tools) - [Dependencies](#dependencies) @@ -114,7 +114,7 @@ $ peertube plugins uninstall --npm-name peertube-plugin-myplugin #### peertube-import-videos.js -You can use this script to import videos from all [supported sites of youtube-dl](https://rg3.github.io/youtube-dl/supportedsites.html) into PeerTube. +You can use this script to import videos from all [supported sites of youtube-dl](https://rg3.github.io/youtube-dl/supportedsites.html) into PeerTube. Be sure you own the videos or have the author's authorization to do so. ```sh @@ -141,6 +141,19 @@ Already downloaded videos will not be uploaded twice, so you can run and re-run Videos will be publicly available after transcoding (you can see them before that in your account on the web interface). +**NB**: If you want to synchronize a Youtube channel to your PeerTube instance (ensure you have the agreement from the author), +you can add a [crontab rule](https://help.ubuntu.com/community/CronHowto) (or an equivalent of your OS) and insert +these rules (ensure to customize them to your needs): + +``` +# Update youtube-dl every day at midnight +0 0 * * * /usr/bin/npm rebuild youtube-dl --prefix /PATH/TO/PEERTUBE/ + +# Synchronize the YT channel every sunday at 22:00 all the videos published since last monday included +0 22 * * 0 /usr/bin/node /PATH/TO/PEERTUBE/dist/server/tools/peertube-import-videos.js -u '__PEERTUBE_URL__' -U '__USER__' --password '__PASSWORD__' --target-url 'https://www.youtube.com/channel/___CHANNEL__' --since $(date --date="-6 days" +%Y-%m-%d) +``` + +Also you may want to subscribe to the PeerTube channel in order to manually check the synchronization is successful. #### peertube-upload.js @@ -195,7 +208,7 @@ Or to transcode to a specific resolution: ``` $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run create-transcoding-job -- -v [videoUUID] -r [resolution] ``` - + ### create-import-video-file-job.js You can use this script to import a video file to replace an already uploaded file or to add a new resolution to a video. PeerTube needs to be running.