Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect user to chat to increase watchtime #47

Merged
merged 10 commits into from
Mar 12, 2021

Conversation

anoviel
Copy link
Contributor

@anoviel anoviel commented Feb 3, 2021

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
Copy link
Owner

Tkd-Alex commented Feb 3, 2021

Thank you for your contributing! 😃

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

TwitchChannelPointsMiner/TwitchChannelPointsMiner.py Outdated Show resolved Hide resolved
TwitchChannelPointsMiner/classes/entities/Chat.py Outdated Show resolved Hide resolved
TwitchChannelPointsMiner/classes/TwitchChat.py Outdated Show resolved Hide resolved
TwitchChannelPointsMiner/classes/entities/Streamer.py Outdated Show resolved Hide resolved
@Tkd-Alex
Copy link
Owner

Tkd-Alex commented Feb 3, 2021

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

@anoviel
Copy link
Contributor Author

anoviel commented Feb 3, 2021

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
Copy link
Owner

Tkd-Alex commented Feb 3, 2021

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
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
Copy link
Owner

Tkd-Alex commented Mar 9, 2021

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
Copy link
Contributor

Signko commented Mar 10, 2021

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
Copy link
Contributor

Signko commented Mar 10, 2021

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
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
Copy link
Contributor

Signko commented Mar 10, 2021

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
Owner

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

@PureFallen
Copy link

PureFallen commented Mar 10, 2021

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

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
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
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
Copy link
Contributor

Signko commented Mar 10, 2021

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
Owner

😢 😢 😢

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

@Tkd-Alex
Copy link
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
Copy link
Contributor

Signko commented Mar 10, 2021

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

@Tkd-Alex
Copy link
Owner

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

@PureFallen
Copy link

PureFallen commented Mar 10, 2021

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
Owner

image

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

@Tkd-Alex
Copy link
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
Copy link
Contributor

Signko commented Mar 12, 2021

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

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
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