aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/doc/import-youtube.md
blob: 3b8b515a74384b707b1ce30be45678ffd83c476f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Import videos from Youtube guide

You can use this script to import videos from Youtube channel to Peertube.  
Be sure you own the videos or have the author's authorization to do so.

 - [Installation](#installation)
 - [Usage](#usage)

## Installation

## Prerequisites

You need at least 512MB RAM to run the script.  
Importation 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.  

### Dependencies

If you do not run the script from a Peertube server, you need to follow the steps of the [dependencies guide](dependencies.md).

### Installation

Clone the Peertube repo to get the latest version inside your server:

```
git clone https://github.com/Chocobozzz/PeerTube.git
CLONE="$(pwd)/Peertube"
```

Run ``yarn install``
```
cd ${CLONE}
yarn install
```

Build server tools:
```
cd ${CLONE}
npm run build:server
```


## Usage

You are now ready to run the script : 

```
cd ${CLONE}
node dist/server/tools/import-youtube.js -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD" -y "YOUTUBE_URL"
```

 - PEERTUBE_URL : the full URL of your peertube server where you want to import, eg: https://peertube.cpy.re/
 - PEERTUBE_USER : your peertube account where videos will be uploaded
 - PEERTUBE_PASSWORD : password of your peertube account
 - YOUTUBE_URL : the youtube channel you want to import. Supports Youtube channel (eg https://www.youtube.com/channel/ChannelId) or Youtube user (eg: https://www.youtube.com/c/UserName or https://www.youtube.com/user/UserName)

 The script will get all public videos from Youtube, download them, then upload to Peertube.  
 Already downloaded videos will not be uploaded twice, so you can run and re-run the script in case of crash, disconnection, ... without problem.