Skip to content

Piero24/twitch-stream-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Status: Work in progress ⚠️
Percentage Completely: 70% 🔋

Script to automatically start the browser when your favorite streamer is online
Explore the docs »

Report BugRequest Feature





📔 Itroduction 📔

This short python script allows you to automatically start the browser (for the moment it is only available with firefox) to see your favorite streamer. In case you are a streamer you can use it to verify that everything is going correctly in your stream.





🧰 Prerequisites 🧰


There are some prerequisites needed to be able to use this script.

1) Have Firefox installed as a browser

2) You have logged in with your browser account (if you don't have one you have to create it)

3) Be registered on the Twitch developer portal (have your twitch ID and your twitch KEY)

4) Downloaded the Selenium drivers for Firefox


⚙️ How to Start ⚙️

1. Install what you need to make everything work

pip install requests
pip install selenium


2. Rename data_empty.py to data.py


3. Login to twitch with you credential (The code should work even without this step but it is highly recommended to do so as it may not work if twitch requests the verification code by mail at login)


4. In the data.py file, enter the path to the folder where the account profile used to log in to firefox is.

In my case (on mac) it looks like this:

firefox_arg = "/Users/username/Library/Application Support/Firefox/Profiles/axglk2qpm.default-release"

Now enter the path of the selenium driver

PATH_firefox = r"/Users/username/Documents/twitch-stream-viewer/geckodriver"

5. Complete the following fields with the required data

# Google e-mail and Twitch e-mail
email = 'YOUR-TWITCH-MAIL'
# Twitch Username
usr = 'YOUR-TWITCH-USERNAME'
# Twitch Password
pswd = 'YOUR-TWITCH-PASSWORD'

# Twitch developer data
twitch_ID = 'YOUR-TWITCH-DEVELOPER-ID'
twitch_KEY = 'YOUR-TWITCH-DEVELOPER-KEY'

# Streamer name and link
streamer_name = 'STREAMER-NAME'



Now everything is ready. To start it in the terminal, go to the folder containing the script and write

python3 main.py



Tips: The bot sends messages as soon as it connects to greet the stream and at regular intervals during the stream to show that it is still there. If you want to change the phrases just change them in the data.py file.

If you want to remove the messages during the stream and have only those at the beginning, just set the following in the data.py file.

mid_time_msg = 0



Copyrright (C) by Pietrobon Andrea
Released date: Nov-2022

Releases

No releases published

Packages

No packages published

Languages