This script checks if specified Twitch streamers are live and opens their streams in a web browser when they go live. It also periodically prompts the user if they want to reopen any previously watched streams.
- Python 3.x
requests
library (install viapip install requests
)
- Clone this repository or download the script.
- Replace
your_client_id
andyour_client_secret
in the script with your Twitch API credentials.
Run the script:
python twitch_live_checker.py
- Authentication: The script uses your Twitch API credentials to obtain an OAuth token.
- Streamer Status Check: It checks if the specified streamers are live by querying the Twitch API.
- Alerts: When a streamer goes live, the script opens their stream in a web browser and plays a beep sound.
- Periodic Prompt: Every hour, the script prompts the user to ask if they want to reopen any previously watched streams.
If no streamers are specified by the user, the script monitors the following default streamers:
theprimeagen
squishymuffinz
rocketleague
johnnyboi_i
rlesports
ranny
You can specify custom streamers by entering their usernames separated by commas within 15 seconds after running the script. If you don't provide any input, the script will use the default list of streamers.
Fetches an OAuth token from Twitch.
Checks if a specific streamer is live on Twitch.
Prompts the user to input streamer names within a specified timeout period.
Prompts the user for input with a timeout.
Periodically prompts the user if they want to reopen previously watched streams.
Main function that initializes the script, monitors streamers, and handles user prompts.
python twitch_live_checker.py
You will be prompted to enter streamer names separated by commas. If no input is provided within 15 seconds, the script will use the default list of streamers.
Feel free to submit issues or pull requests for improvements or additional features.