Home

Awesome

AutoVOD

Releases

This script automates downloading and uploading Twitch.TV, Kick.com or YouTube Live streams to a selected upload provider. <br>

[!IMPORTANT] This does not download and upload the official Twitch/Kick/YouTube VOD after the stream is finished, but rather uses streamlink to record and upload the stream in realtime. So features like separating different audio track for the VOD are not supported. If that is something you are looking for, you should check out Twitch's manual export to YouTube feature.

Current available upload options:

Installation

Automatic Installation

Note Only supports APT or DNF. If you are using a different package manager, you will have to install the required packages manually.

sh -c "$(curl -fsSL https://raw.githubusercontent.com/jenslys/autovod/master/install.sh)"

Manual Installation

<details> <summary>Required packages</summary>

PM2

apt-get install npm
npm install pm2 -g
pm2 startup

Streamlink

apt-get install python3-pip tar
pip3 install --upgrade streamlink

JQ

apt-get install jq

YoutubeUploader

If you want to upload to YouTube

<details> <summary>Instructions</summary> <br>
wget https://github.com/porjo/youtubeuploader/releases/download/23.03/youtubeuploader_23.03_Linux_x86_64.tar.gz
tar -xvf youtubeuploader_23.03_Linux_x86_64.tar.gz && rm youtubeuploader_23.03_Linux_x86_64.tar.gz
mv youtubeuploader /usr/local/bin/youtubeuploader
</details>

Rclone

If you want to upload to an any of the Rclone providers

<details> <summary>Instructions</summary> <br>
apt-get install rclone
</details>

FFMPEG

If you want to enable the re-encoding or re-streaming feature

<details> <summary>Instructions</summary> <br>
apt-get install ffmpeg
</details>

AutoVOD

git clone https://github.com/jenslys/autovod.git
cd autovod

Sample video

wget -c -O sample.mp4 https://download.samplelib.com/mp4/sample-5s.mp4
</details>

Setup

Youtube setup

<details> <summary>Instructions</summary> <br>

Set up your credentials to allow YouTubeUploader to upload videos to YouTube.

  1. Create an account on Google Developers Console

  2. Create a new project

  3. Enable the YouTube Data API (APIs & Auth -> Library)

  4. Go to the Consent Screen section, setup an external application, fill in your information and add the user/s that are going to be using the app (Channel/s you are uploading videos to). Enable the ".../auth/youtube.upload" scope. Then save.

  5. Go to the Credentials section, click "Create credentials" and select "OAuth client ID", select Application Type 'Web Application'. Add a 'Authorised redirect URI' of http://localhost:8080/oauth2callback

  6. Once created click the download (JSON) button in the list and save it as client_secrets.json

  7. Getting token from YouTube:

    1. Due to recent changes to the Google TOS, if you are running this utility for the first time and want to run it on a Headless server, you have to first run youtubeuploader on your local machine (Somewhere with a web browser)

      youtubeuploader -filename sample.mp4
      
    2. and then simply copy/move request.token and client_secrets.json to the remote host. Make sure these are placed inside the autovod folder.

Note To be able to upload videos as either "Unlisted or Public" and upload multiple videos a day, you will have to request an API audit from YouTube. Without an audit your videos will be locked as private and you are limited to how many videos you can upload before you reach a quota.

<details> <summary>Tips on passing the audit</summary> <br>

I have applied for the audit twice (for two separate projects).

Both times I was accepted fairly easily.

Since this tool isn't very complex, I typed almost the same thing on all fields, along the lines of:

"I am going to upload a certain twitch user VODS to YouTube and need a higher quote because the streamer streams multiple times a week for x amount of hours. The tool is internal, so the only person that is authenticating through it is me. This is using Youtube Data API to upload to videos."

I also linked/referenced this GitHub page (Don't know if that helped my case).

The field that wants you to upload a screen recording of the program; I just screen recorded myself doing the youtubeuplaoder --filename sample.mp4 command. Since that is how we get the token from youtube. You could also record the process starting AutoVOD.

Note It took around 20 days from submission to them accepting the audit.

I am leaving open the GitHub issue regarding this, in case people want to discuss or share their experience: #32

</details> </details>

Rclone setup

<details> <summary>Instructions</summary>

Refer to your provider on how to configure Rclone

https://rclone.org/#providers

</details>

Usage

Config file

We will create a dedicated config file for each steamer, in case are monitoring multiple streamers with different settings.

Create config file

Note: Case sensitive, make sure to type the capitalization for the username the same on all inputs and files.

cp default.config StreamerNameHere.config

Edit the config

Edit your newly created config

nano StreamerNameHere.config
Optional additional setup steps
<details> <summary>Stream metadata</summary>

This currently only works if you are using Twitch.TV

If you want to add stream metadata to your video, you will need to deploy an api wrapper for the Twitch API. You can find the instructions on how to do that here. Once you have the wrapper deployed, you will need to add the url in the API_URL field in the config file and enable the API_CALLS field.

</details> <details> <summary>Disable ads</summary>
Fetching the OAuth token from

Follow the instructions here to get your OAuth token.

Then add the OAuth token: --twitch-api-header=Authorization=OAuth YOURCODEHERE to the STREAMLINK_OPTIONS field in the config file.

Other options

Other options can be found here

</details>

Start AutoVOD

pm2 start AutoVOD.sh --name <Streamer Name Here>
pm2 save

Check status

pm2 status

Check logs

pm2 logs

Using docker

This script can be used inside a docker container. To build a container, first execute all Setup-Steps, then build the image:

docker build --build-arg USERNAME=<Streamer Name Here> -t autovod .

You can now run this container

docker run -d autovod <Streamer Name Here>

Or you can run both commands in one line

./buildRunDocker.sh <Streamer Name Here>

FAQ

<details> <summary>I am getting "[Error 32] Broken pipe"</summary> <br>

There are multiple reasons this error can occur, check the following

YouTube

Rclone

Server resource exhaustion

</details> <details> <summary>My tokens keep getting revoked</summary> <br> </details> <details> <summary>My video keeps getting marked as private</summary> <br> </details> <details> <summary>I cant upload videos longer then 15 minutes</summary> <br> </details> <details> <summary>One or more required files are missing</summary> <br>

The following files are required for the script to work:

It should look something like this:

Screenshot

</details>

Credit

License

Licensed under the MIT License