jenslys/autovod

youtubeuploader tries to upload the youtube video even though the stream is offline.

Closed this issue · 1 comments

Describe the bug
youtubeuploader tries to upload the youtube video even though the stream is offline.

Expected behavior
Every time the stream is tested to see if it is online, the YouTube API is also requested, which means that many points of the YouTube API are used up every minute that are actually not needed.

Show logs
8|maximal_schradin | 17:18:23| Trying to fetch stream metadata 8|maximal_schradin | 17:18:24| Stream seems offline, not able to fetch metadata. 8|maximal_schradin | 17:18:24| Checking twitch.tv/maximal_schradin for a stream 8|maximal_schradin | 17:18:24| All required files found 8|maximal_schradin | error: No playable streams found on this URL: twitch.tv/maximal_schradin 8|maximal_schradin | 17:18:26| youtubeuploader failed uploading the stream 8|maximal_schradin | 17:18:26| Trying again in 1 minute

Config

`#!/bin/bash
#shellcheck disable=SC2034
#! Do not edit this file directly, instead create a new file with the name of the streamer you want to record. (e.g: asmongold.config)
set -a

#* Source
STREAM_SOURCE="twitch" #* Options: twitch, kick, youtube

#* Upload provider
UPLOAD_SERVICE="youtube" #* Options: youtube, rclone, restream, local

#* Twitch metadata settings:
API_CALLS="true" #? Enable this to fetch additional metadata from the Twitch API. API_URL must be set to a valid API URL.
API_URL="protected" #? API for fetching stream metadata. (e.g: https://example.com/info/)

#? Variables that can be used in VIDEO_TITLE, YOUTUBE_VIDEO_DESCRIPTION, YOUTUBE_VIDEO_PLAYLIST, RCLONE_FILENAME and LOCAL_FILENAME.
STREAMER_TITLE="initial_title" #? The title of the stream. (This is only available if API_CALLS is set to true.) [! Do not change these values]
STREAMER_GAME="inital_game"    #? The current game the user is playing. (This is only available if API_CALLS is set to true.) [! Do not change these values]
#? $STREAMER_NAME - The name of the streamer.
#? TIME_DATE - The current date (day/month/year).
#? TIME_CLOCK - The current time (hour:minute:second).

#* Streamlink settings (Valid for all upload providers)
STREAMLINK_QUALITY="best"                                               #* Options: worst, 360p, 480p, 720p, 720p60, 1080p60, best
STREAMLINK_FLAGS=("--twitch-disable-reruns" "--twitch-disable-hosting") #? Options to pass to streamlink. (NB! Array not a string) (https://streamlink.github.io/cli.html#twitch)
STREAMLINK_LOGS="error"                                                 #* Options: none, error, warning, info, debug, trace, all

#* Universal Upload settings (Valid for all upload providers)
VIDEO_DURATION="12:00:00"       #? XX:XX:XX (Notice: YouTube has a upload limit of 12 hours per video).
SPLIT_INTO_PARTS="true"        #? If you want to split the video into parts, set this to true. (if this is enabled VIDEO_DURATION is ignored).
SPLIT_VIDEO_DURATION="06:00:00" #? Set the duration of each part. (XX:XX:XX)
SAVE_ON_FAIL="false"            #? If you want to save the non-empty video that failed to upload, set this to true.

#* YouTube upload settings (Only valid if UPLOAD_SERVICE is set to youtube)
VIDEO_TITLE="$STREAMER_NAME - initial_title  - TIME_DATE"                          #? Title of the video.
VIDEO_DESCRIPTION="Uploaded" #? YouTube video description.
VIDEO_VISIBILITY="private"                                           #* Options: unlisted, private, public
VIDEO_PLAYLIST="$STREAMER_NAME VODs"                                  #? Playlist to upload to.

#* Rclone upload settings (Only valid if UPLOAD_SERVICE is set to rclone)
RCLONE_REMOTE="remote-name"                      #? Rclone remote to upload to.
RCLONE_DIR=""                                    #? Directory to upload to.
RCLONE_FILENAME="$STREAMER_NAME"_"TIME_DATE" #? Filename of the video on the remote. (Dont use spaces in the filename, use dashes or undersores instead.)
RCLONE_FILEEXT="mkv"                             #? File extension of the video on the remote.

#* Re-Stream settings (Only valid if UPLOAD_SERVICE is set to restream)
RTMPS_URL="rtmp://a.rtmp.youtube.com/live2/"
RTMPS_STREAM_KEY=""
AUDIO_BITRATE="44100"
AUDIO_CODEC="aac"
FILE_FORMAT="flv"

#* Local settings (Only valid if UPLOAD_SERVICE is set to local)
LOCAL_FILENAME="$STREAMER_NAME"_"TIME_DATE" #? Filename/filepath of the local recording. (Dont use spaces in the filename, use dashes or undersores instead.)
LOCAL_EXTENSION="mkv"                           #? File extension of the local recording.

#* Re-Encoding settings (Currently only works if UPLOAD_SERVICE is set to rclone or local)
#? Re-encodes the stream to a desired codec and quality using ffmpeg. This can be useful if you want to save space on your remote. (Only recommended if you have a high-end server.)
RE_ENCODE="false"         #? Set this to true if you want to re-encode the video.
RE_ENCODE_CODEC="libx265" #* Options: libx265, libvpx-vp9, libaom-av1 (https://ffmpeg.org/ffmpeg-codecs.html)
RE_ENCODE_CRF="25"        #* Options: 0-51 (lower is better quality, but larger file size) (https://slhck.info/video/2017/02/24/crf-guide.html)
RE_ECODE_PRESET="medium"  #* Options: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow (https://trac.ffmpeg.org/wiki/Encode/H.265)
RE_ENCODE_LOG="error"     #* Options: none, error, warning, info, debug, trace, all

set +a`

Desktop (please complete the following information):

  • OS: Ubuntu
  • Version v.2.3.0

fixed in bd89160