Of course, you need the full installation of Node.js and NPM on your system.
(For best results, Node.js >= 8.4 and NPM >= 5.5.1)
-
Download this repository as zip or clone it with
$ git clone https://github.com/zekroTJA/youtube-upload.git
-
You need to install following packages via NPM:
$ npm i googleapis google-auth-library --save
-
Now, place the 'client_secrets.json' (Take a look below how to get it) in the same directory as the scripts
-
Now, insert your location, where the videos will be placed later to upload, if you don't want to place them in the root directory of the scipts.
-
Now, just place some videos in the configured direcotry and start the script with
$ node main.js
First time you started sthe script, you need to open the shown path to chose the YouTUbe account you want to upload to, copy the key and enter it into the console.
Then, there will be generated a file named 'google-apis-nodejs-quickstart.json' where those settings are saved for the next startup. IF you want to clear those settings, just delete the file or start the script as following:
$ node main.js clear
- Now, all videos in the configured folder will be uploaded to the youtube channel.
If you want to use a VPS to upload your videos, you can uplaod multiple videos to the upload server with the upload script in
client\copy.sh
.
- Copy both scripts,
client/chipergen.sh
andclient/copy.sh
to your local client (for example a Raspberry Pi). - Create a ssh chipper for automated uploading videos to the VPS:
$ sh chipergen.sh username@adress
- Now, start the copy script and follow the instructions:
$ sh copy.sh
Of course, the chosen folder on the VPS should be the same like set in the config of the node.js script!
- Go to the Google Api Console
- Create a new project in the top left corner nexto the logo
- Search for 'YouTube Data API v3' and chose it
- Now, click on 'Enable API'
- Go to 'Credential' -> 'Create' -> 'OAuth client ID'
- Chose 'Other', enter a name and klick 'Create'
- Then download the json file with the download button on the right, rename it to
client_secrets.json