Aldaviva / SunsUpStreamsUp

πŸŒ… Automatically start an OBS stream when the sun rises, and stop it when the sun sets

Home Page:https://www.twitch.tv/aldaviva

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸŒ… SunsUpStreamsUp

GitHub Workflow Status Testspace Coveralls

Automatically start an OBS stream when the sun rises, and stop it when the sun sets

  1. Prerequisites
  2. Installation
  3. Configuration
  4. Running

Prerequisites

Installation

  1. Download the latest release ZIP file for your operating system and CPU architecture.
  2. Extract all files from the ZIP file to a directory on your hard drive.
  3. On Linux and Mac OS, enable the executable bit on the program in a terminal.
    chmod +x sunsupstreamsup

Updating

  1. Download the latest release ZIP file for your operating system and CPU architecture.
  2. Extract the executable file (sunsupstreamsup or sunsupstreamsup.exe) from the ZIP file to your installation directory. Do not overwrite your existing appsettings.json.

Configuration

  1. In the OBS menu bar, go to Tools β€Ί WebSocket Server Settings.
  2. Ensure Enable WebSocket Server is checked.
  3. Set a password, or copy the generated password using Show Connect Info β€Ί Server Password β€Ί Copy.
  4. Press OK.
  5. In this program's installation directory, open appsettings.json in a text editor, and set the following properties in the given objects.

geography

Name Values Description
latitude [βˆ’90.0,90.0] Decimal degrees of your location north (+) or south (βˆ’) of the equator, used to determine the local time of sunrise and sunset
longitude (βˆ’180.0,180.0] Decimal degrees of your location east (+) or west (βˆ’) of the prime meridian, used to determine the local time of sunrise and sunset
timeZone IANA zone ID Time zone for your location, from IANA/Olson tzdb (e.g. "America/Los_Angeles"), or omit this to use the computer's local zone
minimumSunlightLevel SunlightLevel Stream will be up whenever the sunlight is at least this bright; one of Daylight (brightest), CivilTwilight (default, a little dark), NauticalTwilight (medium dark), AstronomicalTwilight (very dark), or Night (useless: always live, totally dark). For example, if you set this to CivilTwilight, the stream will start at civil dawn, continue through daylight, and stop at civil dusk.

stream

Name Values Description
obsHostname FQDN or IP address The hostname of the computer running OBS, defaults to "localhost" for when OBS and this program are both installed on the same computer
obsPort [1,65535) TCP port of the OBS WebSocket server, defaults to 4455. If OBS is running on a different computer, any firewall protecting it must allow inbound TCP connections to this port.
obsPassword string OBS WebSocket server password you set or copied, not URL-encoded, defaults to "" for when authentication is disabled
replaceExistingStream boolean Set to false to only start a new stream if your channel is not already live, avoiding interruption of an existing broadcast, or true to always start the stream at the appointed time, even if that means hijacking the channel from a different broadcast. Defaults to false, which requires twitchUsername, twitchClientId, and twitchClientSecret to be provided in order to be effective. Set to true to disable this check, even if it's otherwise configured.
twitchUsername string Your channel name on Twitch. Used when you want to avoid starting a new stream from OBS if you're already broadcasting to your channel from a different computer. Requires twitchClientId and twitchClientSecret to also be set. Defaults to null to always start a stream at the appointed time, even if the channel is already live.
twitchClientId string Client ID you get after creating a Twitch OAuth application. The redirection URL can be http://localhost, and the Client Type must be Confidential. Defaults to null to always start a stream at the appointed time, even if the channel is already live.
twitchClientSecret string Client secret you create on your Twitch application. Defaults to null to always start a stream at the appointed time, even if the channel is already live.

logging

Name Values Description
logLevel object You may optionally change the logging levels of this program

Running

  1. Make sure OBS is already running and ready to start a stream.
  2. Launch this program.
    ./sunsupstreamsup
  3. The program will immediately start the stream if the sun is currently up and the stream is stopped.
  4. The program will continue running, starting and stopping the stream when the sun rises and sets.
  5. To stop this program, press Ctrl+C.

About

πŸŒ… Automatically start an OBS stream when the sun rises, and stop it when the sun sets

https://www.twitch.tv/aldaviva

License:Apache License 2.0


Languages

Language:C# 100.0%