Closed Samekas123 closed 7 months ago
Good idea! As mentioned in #36, it is on my list and I will implement it as soon as I find the time.
Any updates on this? Would love this feature.
Don't want to create a new issue as I believe this enhancement would fix the "problem". Does anyone else notice if they attempt to raid/host another channel, TTV does not recognize spawned instances as raiders? I believe TTV counts instances as "embedded viewers" so I am wondering if that is why they are not included in the counts. Not a significant problem, but I am curious if anyone has found a workaround.
@Mrbigchest Don't viewers have to actively click a button to join a raid? CTVBot is too dumb to do that. Thank you for your patience, I somehow feel I have to first build an account generator, to then use them for mass logins via CTVBot.
I would have figured the same @jlplenio a few months ago I believe it counted all instances as raiders. I too thought it was weird, but it was also a pleasant surprise. However, now understanding better that you don't believe CTVB has that functionality, it could have just been a glitch on TTVs end. Thank you again!
Also, even if you don't implement the mass logins or account generators this has still been an incredible tool. Thank you so much!
Don't want to create a new issue as I believe this enhancement would fix the "problem". Does anyone else notice if they attempt to raid/host another channel, TTV does not recognize spawned instances as raiders? I believe TTV counts instances as "embedded viewers" so I am wondering if that is why they are not included in the counts. Not a significant problem, but I am curious if anyone has found a workaround.
Viewers that aren't logged in don't count in a raid, so that would include these bots.
Do you mean the auth-token from the cookies?
I have login from auth_token, following and chat implemented. But everything relies on graphql communiciaton. My chrome instances always receive an error "failed integrity check" from https://gql.twitch.tv/gql. Firefox works, but I don't want to switch. I am at a loss.
What's the difference between the firefox instances that work verses the chrome instances that don't work? Is this just the nature of p.firefox instances being registered differently than p.chromium? When you run on both are you testing with the same IPs? I know you know way more than me so please ignore if you already understand these differences.
I have played around with the code but I can't get firefox instances to work. When I launch the chromium instances headful, I am not even allowed to log in . So even if the login ISN'T automated I can't even log in period on a chromium instance.
I played around more with the firefox instances yesterday night, in headful I can successfully create accounts/log in with existing accounts while I cannot with chromium (I did not test edge - I would imagine it would look the same as chrome). However, this may be due to my limited altering of the code.
Additionally I get a 2nd window that opens for each firefox instance I spawn saying "we could not find the server at 0,0". This second window does not affect the instance open instance, but if I close it, then the entire instance closes. At least for me, these logged in instances:
Big note: Not every firefox instance I was allowed to log in/create account. It is possible that certain IPs in my proxy_list may be flagged. Could not get a single chrome instance to log in/create account regardless of proxy used.
I hope some of this helps, I apologize that I am not as proficient on the coding end!
FINAL EDIT Everything below doesn't really matter now because I switched to puppeteer in JS with puppeteer-extra-plugin-stealth. I just create a cookie inside of the code with the auth-token and it works perfectly in chrome headless mode. Now I just need to figure out if I can easily implement the JS with my python chat bot code but I might rewrite that in JS as well lol.
---pre-final edit coments---
Obviously this is more work than switching from chrome to firefox for you but I have had some more progress of my own using the following method:
I copy and paste the user profile of a normal chrome browser from the appdata folder in which there are cookies of a logged in twitch account. I then load that into chrome through selenium using with 'user-data-dir=directory_where_you_paste_the_info'. When I load up a browser pointing to that profile it is already logged in and bypasses the "Your browser is not supported" message. The issue now is that it doesn't seem to work headless and I can't even get it to give me a screencap to see what is happening in headless mode so I don't know what to fix.
This obviously is a lot of work if you have a lot of twitch accounts you want to copy and paste the cookies from but it's better then the non stop "your browser is not supported" message lol.
edit: I think I fixed the headless issue, I wasn't properly setting a resolution and also added a chromedriver option to make headless not detectable. Plus Twitch was automatically muting the streams so I just waited a few seconds for the page to load and sent a "m" key press.
edit2: never mind the screenshot in headless shows I'm not logged in but as soon as I remove headless it is logged in.
Hey @unhiro, thank you very much for your extensive research. As Python-puppeteer pyppeteer is unmaintained, I wont switch. I can look and compare the performance and ram footprint of Chrome vs Firefox, though. Your idea of prepopulating the cookies and local/session storage is a good idea to test to make the browser look less artificial. I am happy with the state CTVBot is in now, much more than I ever intended. If I find time, I will look into the Chrome Firefox comparison and cookies/storage prepopulation. As auth-token loging, chatting and following is ready to go.
Yea I wanted to use pyppeteer but it hasn't been updated in 3 years so it was out of the question.
I appreciate all the time you've put into this project. It got me to pick up programming again!
A long side working on this I have been working on a chat bot that uses chatGPT to make the chatters seem more realistic. It's almost complete as well.
Hey @unhiro, thank you very much for your extensive research. As Python-puppeteer pyppeteer is unmaintained, I wont switch. I can look and compare the performance and ram footprint of Chrome vs Firefox, though. Your idea of prepopulating the cookies and local/session storage is a good idea to test to make the browser look less artificial. I am happy with the state CTVBot is in now, much more than I ever intended. If I find time, I will look into the Chrome Firefox comparison and cookies/storage prepopulation. As auth-token loging, chatting and following is ready to go.
How did you implement the auth-token logging if I may ask?
@MrBiggerChest if you login to twitch and inspect the cookies there will be one that contains auth-token. You can recreate this cookie in your code and pass it over to the browser.
Tried again yesterday, unsuccessfully. It must have something to do with the bot mitigation kasada.io. Normally, we shouldn't care because Playwright should behave like a normal browser, but either Twitch or Playwright have made changes recently, because it definitely worked last year. Auth token and chat work, but if you have to follow to chat, then the gql problem occurs when following. This is beyond my expertise and too time-consuming.
Are you following by using Playwright to click the follow button or using the oauth and request to send it directly? I've seen other apps use the the request method but I haven't dug into it because I'm not at that point yet.
I do have a question for you. I have noticed that a random amount of the instances I create will have chat collapsed and they do a real good job of making the expand button hidden as if it was actually the collapse button so no matter what I try I can't detect if it is collapsed, it always reports as if it is expanded. I have even changed the local storage key that saves whether the chat has been saved as expanded or not and it doesn't work. Have you solved this or even encountered it?
The way I am dealing with chat is every spawned browser also spawns a python IRC instance that logs in with the same user and proxy as the one that is connecting through the browser. Even though I am doing that I still want chat to be expanded because if it isn't I don't believe the account collects points in the channel and may not count towards raids. Also if you don't use the irc method and chat isn't expanded the user will not show up in the chat list either.
I have created a log in file, mirroring proxy.py. However, how do I actually get playwright to login to TTV? Sorry if this is a silly Q. Thanks!
^Disregard the above, I have gotten Playwright to login, however, it looks like I have my code that scrapes my usernames and passwords incorrect or something. Anyways cheers!
The way I am dealing with chat is every spawned browser also spawns a python IRC instance that logs in with the same user and proxy as the one that is connecting through the browser. Even though I am doing that I still want chat to be expanded because if it isn't I don't believe the account collects points in the channel and may not count towards raids. Also if you don't use the irc method and chat isn't expanded the user will not show up in the chat list either.
I inject JavaScript before the page load to catch a reference to the web socket that is used to communicate to the IRC chat. If I want to send a chat message, I use JavaScript to send the command via the web socket to the already established IRC connection. Iirc my logged-in users appeared in the user-list in the chat.
Ah okay that's cool. I am going to continue using a separate IRC instance because I've spent a lot of time making things like when some one @'s a bot it will reply and they monitor chat for certain emotes and will join in and also tied it in with chatgpt etc.. I'm going to be testing adding in following today, I will let you know if I get it to work.
I installed an extension in chrome called "Export cookie JSON file for Puppeteer" which allows you to download all cookies of a website you are currently on and saves them into a json file. It has puppeteer in the name but works for Playwright as well. I believe they have example code for both on their github. Now when loading my extra accounts they have all cookies that were sent when I logged in with them.
I ended up being busy and couldn't try until now. I am using puppeteer to click on the follow button and it flashes red and doesn't follow. I think the same thing happens when I get it to click on accepting the bonus points at the bottom of chat but haven't double checked. I even have all the cookies available including the gql one that has the auth token in it.
I might have to look into another method for following outside of puppeteer or playwright.
Yeah, looks like it is a problem with chrome being automated. This could help you in puppeteer: https://developer.chrome.com/articles/new-headless/
Good idea but unfortunately it did not work. There is something else letting them know but I will probably continue to use the dev build from here on out though so thank you for that!
The upcoming version will support token/user login with chat interaction. I am currently busy with bringing this bot into the cloud, with logged in users.
Any update on this?
Working on it, but it needs modifications to the GUI:
waiting this so much
Was just working on this. GraphQL, token login, follow and chatting still work. To bring it into a user-friendly package will still take time. Maybe I'll release an unpolished version for ko-fi supporters - undecided about it, though.
that would be cool
Let us know, I'd be so glad to support you on ko-fi
What would the unpolished version entail? How would it mainly be different from the current release?
For example, simply the functionality of token logins from a tokens.txt. But without any further checks, visualization or GUI adjustments to monitor if it works. With all this included, is what I would want to release as a stable, user-friendly version.
That'd be awesome @jlplenio I'm down to support you on ko-fi for this unpolish version of the app. Let me know how can we do it
same
Em sex., 16 de jun. de 2023 09:15, l3franc3 @.***> escreveu:
That'd be awesome @jlplenio https://github.com/jlplenio I'm down to support you on ko-fi for this unpolish version of the app. Let me know how can we do it
— Reply to this email directly, view it on GitHub https://github.com/jlplenio/crude-twitch-viewer-bot/issues/40#issuecomment-1594584895, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOKMH6JV7OVBAKIKFISBLV3XLRE53ANCNFSM6AAAAAAQMBOFOE . You are receiving this because you commented.Message ID: @.***>
With all this included, is what I would want to release as a stable, user-friendly version.
As much as I would love for you to release that as a beta, or side update while getting the rest of it ready, posting to ko-fi wouldn't be bad either. (though, I'm not a supporter, if you posted that I might be inclined)
I have added a membership option here, https://ko-fi.com/jlplenio/tiers. I plan to release a simple version there with token login in the near future. Please remember that the main purpose of this is to support general development, with no guarantee of exclusive releases. I plan to release everything in full and open source here, given enough time and polish.
I plan to release a simple version there with token login in the near future. Will there be an option to have it use "Username | Password" login potentially, or do you just wanna stick with the auth-token?
user | password
Em seg., 19 de jun. de 2023 10:35, jimminylubbox @.***> escreveu:
I plan to release a simple version there with token login in the near future. Will there be an option to have it use "Username | Password" login potentially, or do you just wanna stick with the auth-token?
— Reply to this email directly, view it on GitHub https://github.com/jlplenio/crude-twitch-viewer-bot/issues/40#issuecomment-1597205902, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOKMH6IL67Q724AETH3GMB3XMBIQJANCNFSM6AAAAAAQMBOFOE . You are receiving this because you commented.Message ID: @.***>
I have successfully tested it with tokens and that is the focus right now. I can try with user/password, but if Twitch has additional captchas here, it might get problematic.
Twitch login via username/password prompts for verification with email code. I don't think you can disable that? Token works flawlessly - the user appears in chat and can follow. Please voice your follow and chat ideas here https://github.com/jlplenio/crude-twitch-viewer-bot/discussions/152
@jlplenio depending on the account type, you don't need a verified email address and if you don't have a verified one it won't prompt for the email code.
Thanks, @jimminylubbox - I'll try again with an unverified account.
I've posted an unpolished version for token authentication for download on https://ko-fi.com/jlplenio/tiers and you can discuss it here: https://github.com/jlplenio/crude-twitch-viewer-bot/discussions/categories/supporter-feature-tester Currently, it only works (users appear in the list of users in chat) for channels that don't require chat rules to be accepted.
Further testing revealed that accepting chat rules only works when there are no GraphQL errors. The GraphQL errors are now registered and logged. They still rarely occur, I need to investigate more - the trial and error is quite time-consuming.
First just want to say, thanks for the work and the bot works great. Are you considering adding the option to add accounts to the bots to make it look more legitimate?