gottagofaster236 / Twitch-Channel-Points-Miner

A simple script that will watch a stream for you and get the channel points
GNU General Public License v3.0
146 stars 46 forks source link

Addition - Watchtime #16

Open misterkoko opened 3 years ago

misterkoko commented 3 years ago

Hello!

Your script collects channel points without a hitch, but since it doesn't show you online in chat it doesn't increase your watchtime (I'm not a 100% sure that's how watchtime works).

Edit: I had your script running on a channel that has the command !watchtime enabled for an hour and my watchtime didn't increase by an hour.

Would it be possible you'd implement that you'd appear as if you're in the channels chat so it would increase the watchtime aswell as claim the points?

gottagofaster236 commented 3 years ago

Thanks for your idea, I'll try to research that in the future. Right now I like how the script does not increase the view count of the stream, and thus does not act as a viewbot. I guess it could be optional then...

misterkoko commented 3 years ago

Could maybe have two separate py scripts like main.py and main_chat.py. Your script already uses websocket and browser_cookie, so I guess you'd only need to collect the oauthToken, userID and clientID to be able to connect to chat (I think that's how it works but I could be wrong).

Thank you for taking it into consideration

gottagofaster236 commented 3 years ago

To join chat, you probably have to connect to Twitch IRC chat, as described in https://dev.twitch.tv/docs/irc/guide

misterkoko commented 3 years ago

Connecting through the SSL websocket worked for me:

SENT: PASS oauth:

SENT: NICK rastafari90

RECEIVED: :tmi.twitch.tv 001 rastafari90 :Welcome, GLHF! :tmi.twitch.tv 002 rastafari90 :Your host is tmi.twitch.tv :tmi.twitch.tv 003 rastafari90 :This server is rather new :tmi.twitch.tv 004 rastafari90 :- :tmi.twitch.tv 375 rastafari90 :- :tmi.twitch.tv 372 rastafari90 :You are in a maze of twisty passages, all alike. :tmi.twitch.tv 376 rastafari90 :>

RECEIVED: PING :tmi.twitch.tv

SENT: PONG :tmi.twitch.tv

SENT: JOIN #lvndmark

RECEIVED: :rastafari90!rastafari90@rastafari90.tmi.twitch.tv JOIN #lvndmark

RECEIVED: :rastafari90.tmi.twitch.tv 353 rastafari90 = #lvndmark :rastafari90 :rastafari90.tmi.twitch.tv 366 rastafari90 #lvndmark :End of /NAMES list

RECEIVED: :lenblix!lenblix@lenblix.tmi.twitch.tv PRIVMSG #lvndmark :!sens

RECEIVED: :nightbot!nightbot@nightbot.tmi.twitch.tv PRIVMSG #lvndmark :@Lenblix - Tarkov - 400 dpi with 0.28 / 0.28 sensitivities (he was playing 0.45/0.45 prior)

image

So maybe the main_chat.py could connect you to the chat of the streamer you specify to get points on. Connect to the websocket, send the oauth token and nickname and the join command. And send the PONG :tmi.twitch.tv command every 5 minutes so you don't get disconnected from chat. After the streamer is offline just PART # to disconnect from chat

ITR13 commented 3 years ago

If implemented it would be nice if this was optional

misterkoko commented 3 years ago

If implemented it would be nice if this was optional

I mentioned that in the 3rd comment: Could maybe have two separate py scripts like main.py and main_chat.py.

jhagin002 commented 3 years ago

@misterkoko There is a much easier way to do this. All you have to do is download Chatterino. It's a chat client for Twitch, and LogicalSolutions and PlagueFPS use it. I saw what channel you were trying to connect to in 3rd comment lmfao thats why I mentioned those two moderators. Nice to see a fellow Tony viewer randomly on the internet haha.

misterkoko commented 3 years ago

@misterkoko There is a much easier way to do this. All you have to do is download Chatterino. It's a chat client for Twitch, and LogicalSolutions and PlagueFPS use it. I saw what channel you were trying to connect to in 3rd comment lmfao thats why I mentioned those two moderators. Nice to see a fellow Tony viewer randomly on the internet haha.

lvndmaRat

For now I just have an automation when streamer X comes online it sends a SSH command to my pc to open the X streamer chat

StephanBruh commented 3 years ago

Create a nodejs script with tmi.js and join all the channels. Run that on your server. And your watchtime will increase, and you will have a higher chance of getting a gifted sub because you are in chat.

misterkoko commented 3 years ago

Create a nodejs script with tmi.js and join all the channels. Run that on your server. And your watchtime will increase, and you will have a higher chance of getting a gifted sub because you are in chat.

Thank you, had no idea about this. So would this be correct?:

const tmi = require('tmi.js');

const client = new tmi.Client({ options: { debug: true }, connection: { reconnect: true }, identity: { username: 'my username', password: 'oauth: oauth token' }, channels: [ 'lvndmark' 'gamergirl' ] });

client.connect();

client.on('message', (channel, tags, message, self) => { // Ignore echoed messages. if(self) return;

if(message.toLowerCase() === '!hello') {
    // "@alca, heya!"
    client.say(channel, `@${tags.username}, heya!`);
}

});

StephanBruh commented 3 years ago

Create a nodejs script with tmi.js and join all the channels. Run that on your server. And your watchtime will increase, and you will have a higher chance of getting a gifted sub because you are in chat.

Thank you, had no idea about this. So would this be correct?:

const tmi = require('tmi.js');

const client = new tmi.Client({ options: { debug: true }, connection: { reconnect: true }, identity: { username: 'my username', password: 'oauth: oauth token' }, channels: [ 'lvndmark' 'gamergirl' ] });

client.connect();

client.on('message', (channel, tags, message, self) => { // Ignore echoed messages. if(self) return;

if(message.toLowerCase() === '!hello') {
  // "@alca, heya!"
  client.say(channel, `@${tags.username}, heya!`);
}

});

Yep that's enough! You don't need to have that !hello command, Just joining the channels is enough