Skip to content

Connect user to chat to increase watchtime - #47

Merged
Tkd-Alex merged 10 commits into
Tkd-Alex:masterfrom
anoviel:chat-client
Mar 12, 2021
Merged

Connect user to chat to increase watchtime#47
Tkd-Alex merged 10 commits into
Tkd-Alex:masterfrom
anoviel:chat-client

Conversation

@anoviel

@anoviel anoviel commented Feb 3, 2021

Copy link
Copy Markdown
Contributor

add irc chat client
list user as viewer in selected chat
viewtime increases while connected

Referenced issue
gottagofaster236/Twitch-Channel-Points-Miner#16

anoviel and others added 3 commits February 3, 2021 18:45
list user as viewer in selected chat
viewtime increases while connected
@Tkd-Alex

Tkd-Alex commented Feb 3, 2021

Copy link
Copy Markdown
Owner

Thank you for your contributing! 😃

I think there are a lot of things that should be changed.
I'll start a review asap!

Comment thread TwitchChannelPointsMiner/TwitchChannelPointsMiner.py Outdated
Comment thread TwitchChannelPointsMiner/classes/entities/Chat.py Outdated
Comment thread TwitchChannelPointsMiner/classes/TwitchChat.py Outdated
Comment thread TwitchChannelPointsMiner/classes/entities/Streamer.py Outdated
@Tkd-Alex

Tkd-Alex commented Feb 3, 2021

Copy link
Copy Markdown
Owner

If you want you can take a look of this https://pypi.org/project/python-twitch-irc/

Comment thread TwitchChannelPointsMiner/classes/TwitchChat.py Outdated
@anoviel

anoviel commented Feb 3, 2021

Copy link
Copy Markdown
Contributor Author

I had some issues getting pre-commit up and running on windows 😅
Thanks for the feedback, I will improve things as soon as possible :)

@Tkd-Alex

Tkd-Alex commented Feb 3, 2021

Copy link
Copy Markdown
Owner

I had some issues getting pre-commit up and running on windows
Thanks for the feedback, I will improve things as soon as possible :)

If you have a problem with pre-commit run the following commands:

  • pre-commit uninstall
  • pip install pyflakes, black, isort
  • isort TwitchChannelPointsMiner/
  • black TwitchChannelPointsMiner/
  • flake8 TwitchChannelPointsMiner/\

So you can check the code manually 😃

@Tkd-Alex

Copy link
Copy Markdown
Owner

@anoviel Have you the time for work on it? or do you prefer that I complete the review?

@Tkd-Alex
Tkd-Alex marked this pull request as draft February 24, 2021 08:56
@Tkd-Alex
Tkd-Alex marked this pull request as ready for review March 9, 2021 20:15
…d with online-offline events. Currently It's working
@Tkd-Alex

Tkd-Alex commented Mar 9, 2021

Copy link
Copy Markdown
Owner

Hi :) After a long time I've updated this PR.
If someone wants to try 😸

@Tkd-Alex Tkd-Alex added the enhancement New feature or request label Mar 9, 2021
@Signko

Signko commented Mar 10, 2021

Copy link
Copy Markdown
Contributor

Hi :) After a long time I've updated this PR.
If someone wants to try 😸

Going to test it for an hour or so. I will let you know if something comes up :)
image

@Signko

Signko commented Mar 10, 2021

Copy link
Copy Markdown
Contributor

10/03/21 03:42:17 - INFO - [__print_report]: Duration 1:21:55.017667 works just fine without any issues appearing.

@Tkd-Alex

Copy link
Copy Markdown
Owner

The script workings as well with on-line/offline events? Because currently I don't know what happened when a streamer go offline and then online again

@Signko

Signko commented Mar 10, 2021

Copy link
Copy Markdown
Contributor

I am not sure about that too. I have not seen this happen in 2 hours just looking at the script work :/

@Tkd-Alex

Copy link
Copy Markdown
Owner

We need a long - running test.
Don't worry about that, I'll test in the afternoon

@PureFallen

PureFallen commented Mar 10, 2021

Copy link
Copy Markdown

Someone could also just open a Private Window/Incognito Tab and check in the Twitch Chat´s Memberlist, if the Accountname is listed. If so, the feature works as intended. It even works for more than 2 streamers, given that the viewlimit does not apply to Twitch Chat. Glad that this was considered in the PR.

However, the new feature draws attention to 2 things:

  • Dealing with channels that don't have Channel Points active

It might be attractive for someone that migrates from another solutions to this software to join the IRC from channels that don't support Channel Points, regardless of the intentional purpose of the software. The reasons for that can vary, like the Watchtime example @anoviel mentioned before, farming alternative currencies such as StreamElements/StreamHeroes (which are measured by time active in chat), qualifying for drops or subscription gifts (which select random people that were in the chatbox in the last x hours) or more.

People could put those streams simply on the very bottom of the list, but assuming every other stream in the list is offline, they might up creating load on script and network for farming Viewtime on a stream it is not worth it... unless there is a way to detect that a channel doesn't support Channel Points?
An alternative approach would be to provide a setting irc_only (default: false) for the Streamer Settings, automatically making them treat with lowest priority and completely ignored for the requests related for Channel Points, Predictions.... stuff like that.

  • Dealing with channels that reward people for being in the chatbox, while the Stream if offline

This sounds really odd in the first moment, but there are Streamer which are actually checking and rewarding people for the time they spend in Chatbox regardless of the Stream's Online State. The reasons for that can vary over wanting to maintain an active chat, even if offline (to make the impression of a healthy/active community) or sometimes even easier: using a selfcoded bot and messing up the Online-Check for it.

Once again there would probably be a setting required to join Streamer´s IRC regardless of their Online State, but at this point it might be even better for the readability and usability to have a seperate list of Streamers in the run.py where people can put streams that are exclusive for IRC usage and configure the behaviour with Offline Streams there, before the "StreamerSettings" in twitch_miner.mine grow even longer...

@Yishaqel

Copy link
Copy Markdown

The latest log (which has been running since last night) takes 100MB because it is saving the messages in the IRC channels. I don't think I can share it but I have received a couple of errors today.

@Tkd-Alex

Copy link
Copy Markdown
Owner

The latest log (which has been running since last night) takes 100MB because it is saving the messages in the IRC channels. I don't think I can share it but I have received a couple of errors today.

They are all messages from irc chat.
I'll remove asap because we don't need them.

@Tkd-Alex

Copy link
Copy Markdown
Owner

Someone could also just open a Private Window/Incognito Tab and check in the Twitch Chat´s Memberlist, if the Accountname is listed

This was already tried and obviously the script It's working. We need just to check If the bot works when a streamer goes offline and online 😄 - I'm currently testing.


unless there is a way to detect that a channel doesn't support Channel Points?

I think yes, should be a way. If you can provide a streamer without channel points maybe I can't find a way.


uhm agree, your message make sense. I got your points.
Currently, I think I'll merge this PR asap and then create a new branch with your idea and proposals. Because seems that @anoviel haven't free time to work on It and for me, It's a little uncomfortable to work on another user's repository. We could consider #47 (comment) as improvements.

@Signko

Signko commented Mar 10, 2021

Copy link
Copy Markdown
Contributor

Keep getting an issue every time the bot leaves the IRC chat.
image
I bet this has something to do with me having Windows :/

@Tkd-Alex

Copy link
Copy Markdown
Owner

😢 😢 😢

On Linux for the moment no problem when the streamer goes offline.
image

@Tkd-Alex

Copy link
Copy Markdown
Owner

Are you able to edit add a time sleep here?
https://github.com/anoviel/Twitch-Channel-Points-Miner-v2/blob/46918fda9b181af2fa5243587cdf9256b4fcc129/TwitchChannelPointsMiner/classes/entities/Chat.py#L26-L27

import time
....
code
code
....
self.reactor.process_once(timeout=0.2)
time.sleep(0.01)

We could also surround with try except and see if something change.

@Signko

Signko commented Mar 10, 2021

Copy link
Copy Markdown
Contributor

Bruh, it just fixed itself without me making any changes.

@Tkd-Alex

Copy link
Copy Markdown
Owner

Awesome! 🤣
Anyway I think I'll do this changes just for prevent future errors.

@PureFallen

PureFallen commented Mar 10, 2021

Copy link
Copy Markdown

unless there is a way to detect that a channel doesn't support Channel Points?

I think yes, should be a way. If you can provide a streamer without channel points maybe I can't find a way.

Not want to advertise Streamers, but you could take a look into Twitch's "Slots" Category. Streamer which exclusively stream Slots don't meet the requirements for Affiliation/Partnership and can't enable Channel Points because of that.
You will find someone really quickly there^^

uhm agree, your message make sense. I got your points.
Currently, I think I'll merge this PR asap and then create a new branch with your idea and proposals. Because seems that @anoviel haven't free time to work on It and for me, It's a little uncomfortable to work on another user's repository. We could consider #47 (comment) as improvements.

Oh, sure. I am just extremly unexperienced with Github in general. Should learn that at some point. Limiting it to theorycrafting most of the time for now. I really appreciate help with that.

@Tkd-Alex

Copy link
Copy Markdown
Owner

image

Here another error 😢
I'm currently working on this.

@Tkd-Alex

Copy link
Copy Markdown
Owner

Seems to be stable.
I'll merge asap, anyone has founded problems?

@PureFallen after the merge please open a new issue. You can easily do a Copy & Paste or open new issue directly via GitHub.

image

@Signko

Signko commented Mar 12, 2021

Copy link
Copy Markdown
Contributor

Seems to be stable.
I'll merge asap, anyone has founded problems?

Left the script running over this night. After reading logs, no issues have been found. (Despite this issue #47 (comment) but it fixed itself. )

@DanzoGit

Copy link
Copy Markdown

Is it currently working? Unfortunately it doesn't work for me. My nickname is not in the list of users on the stream. And the viewing time at Streamelements is obviously not increasing.
P.S. Windows 10 x64, Python 3.9.6

@Tkd-Alex

Copy link
Copy Markdown
Owner

Is it currently working? Unfortunately it doesn't work for me. My nickname is not in the list of users on the stream. And the viewing time at Streamelements is obviously not increasing. P.S. Windows 10 x64, Python 3.9.6

Please open a new issue and post your settings. Make sure to have join_chat=True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants