]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - support/doc/tools.md
import-videos: prompt for password
[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 You need to follow all the following steps even if you are on a PeerTube server.
15
16 ### Dependencies
17
18 Install the [PeerTube dependencies](dependencies.md).
19
20 ### Installation
21
22 Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server):
23
24 ```
25 $ git clone https://github.com/Chocobozzz/PeerTube.git
26 $ CLONE="$(pwd)/PeerTube"
27 ```
28
29 Run ``yarn install``
30 ```
31 $ cd ${CLONE}
32 $ yarn install
33 ```
34
35 Build server tools:
36 ```
37 $ cd ${CLONE}
38 $ npm run build:server
39 ```
40
41 ## Tools
42
43 ### import-videos.js
44
45 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.
46 Be sure you own the videos or have the author's authorization to do so.
47
48
49 ```
50 $ cd ${CLONE}
51 $ node dist/server/tools/import-videos.js -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD" -t "TARGET_URL"
52 ```
53
54 * PEERTUBE_URL : the full URL of your PeerTube server where you want to import, eg: https://peertube.cpy.re/
55 * PEERTUBE_USER : your PeerTube account where videos will be uploaded
56 * PEERTUBE_PASSWORD : password of your PeerTube account (if ommited, you will be prompted for)
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
64
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...
67
68 ### upload.js
69
70 You can use this script to import videos directly from the CLI.
71
72 ```
73 $ cd ${CLONE}
74 $ node dist/server/tools/upload.js --help
75 ```