D3vl0per / Twitch-watcher

Automatic watching the twitch to get Valorant drop
MIT License
226 stars 65 forks source link

app.js -> Add ability to specify 3 'high priority' channels to watch #81

Open RFBomb opened 4 years ago

RFBomb commented 4 years ago

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:

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

RFBomb commented 4 years ago

I think the best way to perform the check would be make a call to the twitch api. I have no experience with API calls though.

Here are some links I found:

https://discuss.dev.twitch.tv/t/check-if-streamer-is-online/22672/2

https://discuss.dev.twitch.tv/t/check-whether-channel-is-online-or-not-via-js-solution-found/2019

tetreum commented 3 years ago

This PR is not longer required, as this got merged: https://github.com/D3vl0per/Twitch-watcher/pull/84

RFBomb commented 3 years ago

As I posted in #84 , that change did not satisfy the problem at all.

I have tested and published my mod using the HELIX API here: https://github.com/RFBomb/Twitch-watcher https://hub.docker.com/repository/docker/rfbomb/warframe_watcher

My update to the code is based on the base sourcecode here from a few months back. It involves bit of a major rework in order to incorporate the HELIX API to grab preferred stream status. I have built an entire module that works well if you wish to implement it here.