]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - support/doc/tools.md
Update documentations
[github/Chocobozzz/PeerTube.git] / support / doc / tools.md
1 # CLI tools guide
2
3 - [Installation](#installation)
4 - [Usage](#usage)
5 - [import-videos.js](#import-videosjs)
6 - [upload.js](#uploadjs)
7
8 ## Installation
9
10 ## Prerequisites
11
12 You need at least 512MB RAM to run the script.
13 Scripts can be launched directly from a PeerTube server, or from a separate server, even a desktop PC.
14
15 ### Dependencies
16
17 Install the [PeerTube dependencies](dependencies.md).
18
19 ### Installation
20
21 Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server):
22
23 ```
24 git clone https://github.com/Chocobozzz/PeerTube.git
25 CLONE="$(pwd)/PeerTube"
26 ```
27
28 Run ``yarn install``
29 ```
30 cd ${CLONE}
31 yarn install
32 ```
33
34 Build server tools:
35 ```
36 cd ${CLONE}
37 npm run build:server
38 ```
39
40 ## Tools
41
42 ### import-videos.js
43
44 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.
45 Be sure you own the videos or have the author's authorization to do so.
46
47
48 ```
49 cd ${CLONE}
50 node 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
69 You can use this script to import videos directly from the CLI.
70
71 ```
72 cd ${CLONE}
73 node dist/server/tools/upload.js --help
74 ```