diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-05 10:00:15 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-05 10:00:15 +0100 |
commit | 358770dbbd88136b211090832b24cf3d5b648234 (patch) | |
tree | d02ead83bf3ad24bacf64664603da2cc25ac46c4 /support/doc/tools.md | |
parent | ad34cfc8ac6ad537265c0e24daf30ee7cacd8e06 (diff) | |
download | PeerTube-358770dbbd88136b211090832b24cf3d5b648234.tar.gz PeerTube-358770dbbd88136b211090832b24cf3d5b648234.tar.zst PeerTube-358770dbbd88136b211090832b24cf3d5b648234.zip |
Refractor tools documentation
Diffstat (limited to 'support/doc/tools.md')
-rw-r--r-- | support/doc/tools.md | 74 |
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 | |||
12 | You need at least 512MB RAM to run the script. | ||
13 | Scripts 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 | |||
17 | Install the [PeerTube dependencies](dependencies.md). | ||
18 | |||
19 | ### Installation | ||
20 | |||
21 | Clone the PeerTube repo to get the latest version: | ||
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 | ``` | ||