Open afdah opened 3 weeks ago
I was thinking the same thing, I don't think it necessarily needs multithreading though, just the ability to run all accounts or at most like 5 account in parallel. The problem is that when you have 10+ accounts it takes so long to get back to the first account that the amounts of taps available is always at its maximum.
Running multiple accounts in parallel can lead to blocking of api requests for spam due to the limitation of api request frequency, only if you do not use a separate proxy for each account. if you are willing to try you can use the asyncio library and aiohttp for example to implement asynchronous startup of each account. this would require rewriting most of the main script
You can create several folders with bots, fill the config file of each bot with different accounts and run each bot and check my assumption. it's stupid and inconvenient but to check why not?
Maybe implement it but give a warning that it should only be used that way with proxys for each account? Yea I guessed several folders would work but it's a bit messy to do it that way imo.
I tried to implement asynchronous start of accounts, I checked on my 2 accounts, it works, but I have no proxy, so I can not guarantee the work for you. and I do not plan to update under new updates of the main script so if you triple this option you will have to update the asynchronous script yourself based on the corrections of the original script. also removed sending messages to telegram to simplify modification. also there will be a mess in the logs of several parallel accounts and the more accounts the more difficult it will be to observe the process. the aiohttp
library may need to be installed additionally for operation
I made some mistakes in the body of the main method, here is the corrected version
upd: Most likely, there is an error in the main method where previously there were return and now continue because of which the loop will start from the beginning and not reach the end. as I said before, you need to rewrite not a small part of the script logic to work correctly.
upd2: Another attempt to fix my shitty code to a working state under a spoiler
You can create several folders with bots, fill the config file of each bot with different accounts and run each bot and check my assumption. it's stupid and inconvenient but to check why not?
i got 8 accounts with individual proxy each. 4 bots with 2 accounts each. its working but if i intend to add more accounts, it will be a hassle.
I made some mistakes in the body of the main method, here is the corrected version
upd: Most likely, there is an error in the main method where previously there were return and now continue because of which the loop will start from the beginning and not reach the end. as I said before, you need to rewrite not a small part of the script logic to work correctly.
upd2: Another attempt to fix my shitty code to a working state under a spoiler
main_async.py
i got your script to work. 8 accounts with individual proxy. i assume its running 8 accounts in parallel.
i was looking at thread pool. where i can set my max workers to 2 so i can control the number of bots running in parallel. i'm not sure if i can do that in asyncio. https://www.geeksforgeeks.org/multithreading-python-set-1/
It's very simple! If you have, say, 50 accounts, just distribute 10 each. copy the original script folder 5 times, and add 10 accounts to each separate folder, and run 5 different scripts. that's all. you will have 10 accounts working in 5 different processes
I made some mistakes in the body of the main method, here is the corrected version
upd: Most likely, there is an error in the main method where previously there were return and now continue because of which the loop will start from the beginning and not reach the end. as I said before, you need to rewrite not a small part of the script logic to work correctly.
upd2: Another attempt to fix my shitty code to a working state under a spoiler
main_async.py
If its fully working can you create a pull request?
If its fully working can you create a pull request?
I do not plan to commit this version, if the author of the repository wants he will add my asynchronous version himself. I believe that I do not have the moral right to interfere so much with the original project and do not plan to further support this asynchronous version. this is just an example of a theoretically working variant but since I do not have several accounts and enough proxies to check the full correctness of this variant.
i got 8 accounts with individual proxy each. 4 bots with 2 accounts each. its working but if i intend to add more accounts, it will be a hassle.
Can you please share proxy addresses or instructions on where to get working addresses?
i got 8 accounts with individual proxy each. 4 bots with 2 accounts each. its working but if i intend to add more accounts, it will be a hassle.
Can you please share proxy addresses or instructions on where to get working addresses?
It's very simple! If you have, say, 50 accounts, just distribute 10 each. copy the original script folder 5 times, and add 10 accounts to each separate folder, and run 5 different scripts. that's all. you will have 10 accounts working in 5 different processes
i think this is best solution for now, if using linux/vps you can using multiple screen to run it, or using service (systemd), you can see here #12
me using too:
Is it possible to support multithreading? To speed things up especially for multi accounts with proxy.