Skip to content

Commit

Permalink
adding option to skip twitch thumbnail double checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Bombg committed Oct 15, 2024
1 parent 24752e4 commit 5a8c5ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion DefaultConstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,8 @@ class Constants:
# Calm is default bot avatar, pissed is what it changes to after MIN_TIME_BEFORE_AVATAR_CHANGE has been met
# Make them the same image if you don't want the feature to change anything
calmAvatar = 'images/avatars/calmStreamer.png'
pissedAvatar = 'images/avatars/pissedStreamer.png'
pissedAvatar = 'images/avatars/pissedStreamer.png'

# In some cases a Twitch channel will show online when they aren't. If that's the case turn this to TRUE.
# This checks the channel's thumbnail to see if it is actually online with the downside of it taking a while longer to show the streamer as online
twitchCheckThumbnail = False
3 changes: 2 additions & 1 deletion checkers/Twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def isModelOnline(twitchChannelName):
logger.debug(f"IsOnline: {isOnlineJson}")
logger.debug(f"ThumbUrl: {tempThumbUrl}")
logger.debug(f"ThumbReqUrl:{thumbUrlReq.url}")
if isOnlineJson and tempThumbUrl == thumbUrlReq.url:
thumbnailGood = tempThumbUrl == thumbUrlReq.url if Constants.twitchCheckThumbnail else True
if isOnlineJson and thumbnailGood:
tempThumbUrl = tempThumbUrl + "?" + str(int(time.time()))
isOnline = True
except requests.exceptions.ConnectTimeout:
Expand Down

0 comments on commit 5a8c5ce

Please sign in to comment.