I wanted to re-work this to watch Twitch.tv/warframe, and after poking through the code, I feel like it could work great. The only hiccup would be actually getting the specific channel that I want to watch, instead of the random channels.
The changes include several new routines:
- ViewPriority -> This is now the main loop (instead of ViewRandomPage being the main loop). It allows checking for several high-priority streams to view before viewing any random channels.
- ViewURL -> I moved all of the pertinent code from the ViewRandomPage routine into this new routine. This is what will allow specific channels to be watched, while keeping the total code smaller (and mostly the same)
- CheckStreamerOnline -> This routine is mocked up, but I'll be honest that I am unsure of how to perform this check at the moment. This routine would return a boolean TRUE if the requested stream is online. The ViewPriority routine would then call the ViewURL to go to that stream.
- SleepWatching -> This routine checks if there are any high priority streams running. If there is a higher priority stream running, it will stop sleeping and allow the ViewPriority loop to decide which page to go to next. If no high priority stream is running it will run out the sleep timer in 1 minute increments, checking for higher priorities each loop.
Since this new code will support up to three 'high priority' channels, and I know some people have data caps or other resources they want to be aware of , I also added in the ability to completely ignore the random streams. If enabled, it will ONLY check the specified channels. I have also added some safeguards to avoid refreshing the page if on a high priority stream, and if the 'ignore' function is turned on, but no high priority streams are available, it will refresh the browser and sit idle, and check every 2 minutes. This should save some resources for the end user's system, as well as save the data cost (if they care about it)
These are the commands to be added into the docker environment list:
#- IgnoreRandomChannels=TRUE #Disables viewing random channels and sits idle if no High-Priority channels are live
- ChannelName_1='Warframe' # High Priority Channel 1 - supply only the channel name here!
- ChannelName_2='Valorant'
- ChannelName_3=''