]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
add import-youtube guide inside documentation (#298)
authorLecygneNoir <victor.jlc@laposte.net>
Mon, 19 Feb 2018 08:42:43 +0000 (09:42 +0100)
committerChocobozzz <me@florianbigard.com>
Mon, 19 Feb 2018 08:42:43 +0000 (09:42 +0100)
* add import-youtube guide inside documentation

* safer to use unlink instead of rm to delete symbolic link, avoid risk of deleting entire directories in case of syntax error

* spelling mistake corrections

* anonymise URLs

* git also needed as dependencies to run yarn install

support/doc/dependencies.md
support/doc/import-youtube.md [new file with mode: 0644]
support/doc/production.md

index 4ced42b8b4bcf52a24b4839f535384b90daac80d..a4a30374c6be4c57ee52f53b0f99cced73172073 100644 (file)
@@ -10,7 +10,7 @@
 
 ```
 $ sudo apt update
-$ sudo apt install nginx ffmpeg postgresql openssl g++ make redis-server
+$ sudo apt install nginx ffmpeg postgresql openssl g++ make redis-server git
 ```
 
 ## Arch Linux
@@ -36,7 +36,7 @@ $ sudo pacman -S nodejs yarn ffmpeg postgresql openssl redis
 $ sudo yum update
 $ sudo yum install epel-release
 $ sudo yum update
-$ sudo yum install nginx postgresql postgresql-server openssl gcc make redis
+$ sudo yum install nginx postgresql postgresql-server openssl gcc make redis git
 ```
 
 ## Other distributions
diff --git a/support/doc/import-youtube.md b/support/doc/import-youtube.md
new file mode 100644 (file)
index 0000000..3b8b515
--- /dev/null
@@ -0,0 +1,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.
\ No newline at end of file
index fc2bd460ac0d0f9fe5f2efde83f80200a8777102..6d6cd68f8c807287d1e15ddb39ecdaaf5dbe4b80 100644 (file)
@@ -202,7 +202,7 @@ Change the link to point to the latest version:
 
 ```
 $ cd /var/www/peertube && \
-    sudo rm ./peertube-latest && \
+    sudo unlink ./peertube-latest && \
     sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest
 ```
 
@@ -218,7 +218,7 @@ Change `peertube-latest` destination to the previous version and restore your SQ
 
 ```
 $ OLD_VERSION="v0.42.42" && SQL_BACKUP_PATH="backup/sql-peertube_prod-2018-01-19T10:18+01:00.bak" && \
-    cd /var/www/peertube && rm ./peertube-latest && \
+    cd /var/www/peertube && unlink ./peertube-latest && \
     sudo -u peertube ln -s "versions/peertube-$OLD_VERSION" peertube-latest && \
     pg_restore -U peertube -W -h localhost -c -d peertube_prod "$SQL_BACKUP_PATH"
     sudo systemctl restart peertube