]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/doc/tools.md
fixing #595 by using the account name instead of the displayName
[github/Chocobozzz/PeerTube.git] / support / doc / tools.md
CommitLineData
358770db 1# CLI tools guide
2519d9fe
L
2
3 - [Installation](#installation)
4 - [Usage](#usage)
635a5686
C
5 - [import-videos.js](#import-videosjs)
6 - [upload.js](#uploadjs)
2519d9fe
L
7
8## Installation
9
10## Prerequisites
11
99402413
C
12You need at least 512MB RAM to run the script.
13Scripts can be launched directly from a PeerTube server, or from a separate server, even a desktop PC.
05e67d62 14You need to follow all the following steps even if you are on a PeerTube server.
2519d9fe
L
15
16### Dependencies
17
358770db 18Install the [PeerTube dependencies](dependencies.md).
2519d9fe
L
19
20### Installation
21
99402413 22Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server):
2519d9fe
L
23
24```
05e67d62
C
25$ git clone https://github.com/Chocobozzz/PeerTube.git
26$ CLONE="$(pwd)/PeerTube"
2519d9fe
L
27```
28
29Run ``yarn install``
30```
05e67d62
C
31$ cd ${CLONE}
32$ yarn install
2519d9fe
L
33```
34
35Build server tools:
36```
05e67d62
C
37$ cd ${CLONE}
38$ npm run build:server
2519d9fe
L
39```
40
358770db 41## Tools
2519d9fe 42
358770db
C
43### import-videos.js
44
45You can use this script to import videos from all [supported sites of youtube-dl](https://rg3.github.io/youtube-dl/supportedsites.html) into PeerTube.
46Be sure you own the videos or have the author's authorization to do so.
2519d9fe 47
2519d9fe
L
48
49```
05e67d62
C
50$ cd ${CLONE}
51$ node dist/server/tools/import-videos.js -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD" -t "TARGET_URL"
2519d9fe
L
52```
53
50a3f3b8 54 * PEERTUBE_URL : the full URL of your PeerTube server where you want to import, eg: https://peertube.cpy.re
35501c0f 55 * PEERTUBE_USER : your PeerTube account where videos will be uploaded
066fc8ba 56 * PEERTUBE_PASSWORD : password of your PeerTube account (if ommited, you will be prompted for)
61b3e146
C
57 * TARGET_URL : the target url you want to import. Examples:
58 * YouTube:
59 * Channel: https://www.youtube.com/channel/ChannelId
60 * User https://www.youtube.com/c/UserName or https://www.youtube.com/user/UserName
61 * Video https://www.youtube.com/watch?v=blabla
62 * Vimeo: https://vimeo.com/xxxxxx
63 * Dailymotion: https://www.dailymotion.com/xxxxx
2519d9fe 64
35501c0f
C
65 The script will get all public videos from Youtube, download them and upload to PeerTube.
66 Already downloaded videos will not be uploaded twice, so you can run and re-run the script in case of crash, disconnection...
358770db
C
67
68### upload.js
69
70You can use this script to import videos directly from the CLI.
71
72```
05e67d62
C
73$ cd ${CLONE}
74$ node dist/server/tools/upload.js --help
358770db 75```