aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/doc/tools.md
diff options
context:
space:
mode:
Diffstat (limited to 'support/doc/tools.md')
-rw-r--r--support/doc/tools.md74
1 files changed, 74 insertions, 0 deletions
diff --git a/support/doc/tools.md b/support/doc/tools.md
new file mode 100644
index 000000000..4e431b3d4
--- /dev/null
+++ b/support/doc/tools.md
@@ -0,0 +1,74 @@
1# CLI tools guide
2
3 - [Installation](#installation)
4 - [Usage](#usage)
5 - [import-videos.js](#import-videos.js)
6 - [upload.js](#upload)
7
8## Installation
9
10## Prerequisites
11
12You need at least 512MB RAM to run the script.
13Scripts can be launched directly from a PeerTube server (in this case you already have dependencies installed :+1:) or from a separate server, even a dekstop PC.
14
15### Dependencies
16
17Install the [PeerTube dependencies](dependencies.md).
18
19### Installation
20
21Clone the PeerTube repo to get the latest version:
22
23```
24git clone https://github.com/Chocobozzz/PeerTube.git
25CLONE="$(pwd)/PeerTube"
26```
27
28Run ``yarn install``
29```
30cd ${CLONE}
31yarn install
32```
33
34Build server tools:
35```
36cd ${CLONE}
37npm run build:server
38```
39
40## Tools
41
42### import-videos.js
43
44You can use this script to import videos from all [supported sites of youtube-dl](https://rg3.github.io/youtube-dl/supportedsites.html) into PeerTube.
45Be sure you own the videos or have the author's authorization to do so.
46
47
48```
49cd ${CLONE}
50node dist/server/tools/import-videos.js -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD" -t "TARGET_URL"
51```
52
53 * PEERTUBE_URL : the full URL of your PeerTube server where you want to import, eg: https://peertube.cpy.re/
54 * PEERTUBE_USER : your PeerTube account where videos will be uploaded
55 * PEERTUBE_PASSWORD : password of your PeerTube account
56 * TARGET_URL : the target url you want to import. Examples:
57 * YouTube:
58 * Channel: https://www.youtube.com/channel/ChannelId
59 * User https://www.youtube.com/c/UserName or https://www.youtube.com/user/UserName
60 * Video https://www.youtube.com/watch?v=blabla
61 * Vimeo: https://vimeo.com/xxxxxx
62 * Dailymotion: https://www.dailymotion.com/xxxxx
63
64 The script will get all public videos from Youtube, download them and upload to PeerTube.
65 Already downloaded videos will not be uploaded twice, so you can run and re-run the script in case of crash, disconnection...
66
67### upload.js
68
69You can use this script to import videos directly from the CLI.
70
71```
72cd ${CLONE}
73node dist/server/tools/upload.js --help
74```