See the [production guide](/support/doc/production.md).
-## Contributing
+## Contributing/Test
See the [contributing
guide](/.github/CONTRIBUTING.md)
-to see how to contribute to PeerTube. Spoiler alert: you don't need to be a
+to see how to test or contribute to PeerTube. Spoiler alert: you don't need to be a
coder to help!
## API REST documentation
* HTML version: [/support/doc/api/html/index.html](/support/doc/api/html/index.html)
* Swagger/OpenAPI schema: [/support/doc/api/openapi.yaml](/support/doc/api/openapi.yaml)
+## Tools
+
+ * [YouTube import](/support/doc/import-youtube.md)
+
## Architecture
See [ARCHITECTURE.md](/ARCHITECTURE.md) for a more detailed explanation.
youtubeDL.getInfo(program['youtubeUrl'], options, processOptions, async (err, info) => {
if (err) throw err
+ let infoArray: any[]
+
// Normalize utf8 fields
- info = info.map(i => normalizeObject(i))
+ if (Array.isArray(info) === true) {
+ infoArray = info.map(i => normalizeObject(i))
+ } else {
+ infoArray = [ normalizeObject(info) ]
+ }
- const videos = info.map(i => {
+ const videos = infoArray.map(i => {
return { url: 'https://www.youtube.com/watch?v=' + i.id, name: i.title }
})
## 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.
+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).
+ * [PeerTube dependencies](dependencies.md)
+ * git
### Installation
-Clone the Peertube repo to get the latest version inside your server:
+Clone the PeerTube repo to get the latest version:
```
git clone https://github.com/Chocobozzz/PeerTube.git
-CLONE="$(pwd)/Peertube"
+CLONE="$(pwd)/PeerTube"
```
Run ``yarn install``
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)
+ * 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 video/user/channel/playlist you want to import. Examples:
+ * Channel: https://www.youtube.com/channel/ChannelId
+ * User https://www.youtube.com/c/UserName or https://www.youtube.com/user/UserName
+ * Video https://www.youtube.com/watch?v=blabla
- 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.
\ No newline at end of file
+ The script will get all public videos from Youtube, download them and 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...