]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/doc/tools.md
Add license info to readme (#370)
[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.
2519d9fe
L
14
15### Dependencies
16
358770db 17Install the [PeerTube dependencies](dependencies.md).
2519d9fe
L
18
19### Installation
20
99402413 21Clone the PeerTube repo to get the latest version (even if you are on your PeerTube server):
2519d9fe
L
22
23```
24git clone https://github.com/Chocobozzz/PeerTube.git
35501c0f 25CLONE="$(pwd)/PeerTube"
2519d9fe
L
26```
27
28Run ``yarn install``
29```
30cd ${CLONE}
31yarn install
32```
33
34Build server tools:
35```
36cd ${CLONE}
37npm run build:server
38```
39
358770db 40## Tools
2519d9fe 41
358770db
C
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.
2519d9fe 46
2519d9fe
L
47
48```
49cd ${CLONE}
245dc51d 50node dist/server/tools/import-videos.js -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD" -t "TARGET_URL"
2519d9fe
L
51```
52
35501c0f
C
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
61b3e146
C
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
2519d9fe 63
35501c0f
C
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...
358770db
C
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```