![]() |
|
[Python] Twitch ban checker (Multi-threaded) - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] Twitch ban checker (Multi-threaded) (/showthread.php?tid=5988453) Pages: Pages
1
2
|
Twitch ban checker (Multi-threaded) - Kallu609 - Jul 10, 2019 Made this while ago and decided to share because I don't really have need for this. Maybe this will help someone. E: Updated multiple times. This post has most up-to-date version RE: Twitch ban checker (Multi-threaded) - rabbi - Jul 10, 2019 (Jul 10, 2019 12:11 PM)Kallu609 Wrote: Made this while ago and decided to share because I don't really have need for this. Maybe this will help someone. so it just goes through a textfile and checks to see if the account is banned or not? what was your reasoning for first starting out the project RE: Twitch ban checker (Multi-threaded) - Kallu609 - Jul 10, 2019 (Jul 10, 2019 12:19 PM)faded Wrote: so it just goes through a textfile and checks to see if the account is banned or not? what was your reasoning for first starting out the project I got request from fellow HF user to make program for him to mass check his accounts. I wouldn't call this a "project", a snippet at most. I struggled a lot on beginning of my Python career with multithreading, hopefully this will help someone. It really isn't as hard as it first seems. RE: Twitch ban checker (Multi-threaded) - rabbi - Jul 10, 2019 (Jul 10, 2019 12:22 PM)Kallu609 Wrote: I got request from fellow HF user to make program for him to mass check his accounts. I wouldn't call this a "project", a snippet at most. ah i see, glad you could help someone out RE: Twitch ban checker (Multi-threaded) - l0lwtf - Jul 10, 2019 Code with lock:Does this close the file handle correctly? I don't think so? Maybe I'm mistaken due to the 'with'. RE: Twitch ban checker (Multi-threaded) - Kallu609 - Jul 10, 2019 (Jul 10, 2019 03:04 PM)l0lwtf Wrote: You're right. It doesn't close the file handle properly. I updated main post for better version. RE: Twitch ban checker (Multi-threaded) - Scraping - Jul 11, 2019 Thanks for this Kallu, I'm pretty new to python but this looks pretty handy. I never really thought about multithreading, I'm going to go through your code and comment some of the lines to try and better understand it. RE: Twitch ban checker (Multi-threaded) - datguy.dev - Jul 12, 2019 I like making Twitch related scripts too. You might want to add a 1 second delay between each request to avoid rate limit issues. RE: Twitch ban checker (Multi-threaded) - Kallu609 - Jul 12, 2019 (Jul 12, 2019 04:50 AM)datguy.dev Wrote: I like making Twitch related scripts too. You might want to add a 1 second delay between each request to avoid rate limit issues. I don't know if there's any. I ran 100s of requests and it still gave the right response so I think you can abuse that API endpoint all you want. RE: Twitch ban checker (Multi-threaded) - datguy.dev - Jul 12, 2019 (Jul 12, 2019 05:55 AM)Kallu609 Wrote: I don't know if there's any. I ran 100s of requests and it still gave the right response so I think you can abuse that API endpoint all you want. They have never really posted an official API rate limit tat I've seen. But there is code there as I've been hit with the "Rate Limit Exceeded" response. If you to become a problem, I'm sure they would ban your client id or IP. It's just a good practice to not beat on APIs if you don't have to. RE: Twitch ban checker (Multi-threaded) - vorticalbox - Jul 14, 2019 r.text looks like a JSON response any reason you're not loading it into a dictionary? RE: Twitch ban checker (Multi-threaded) - Kallu609 - Jul 14, 2019 (Jul 14, 2019 07:40 AM)vorticalbox Wrote: r.text looks like a JSON response any reason you're not loading it into a dictionary? It's more efficient to just read few characters from start of string than parsing JSON and checking it's value. RE: Twitch ban checker (Multi-threaded) - vorticalbox - Jul 15, 2019 (Jul 14, 2019 12:51 PM)Kallu609 Wrote: It's more efficient to just read few characters from start of string than parsing JSON and checking it's value. doesn't it all ready have it as json? which you can access via .json() RE: Twitch ban checker (Multi-threaded) - Kallu609 - Jul 15, 2019 (Jul 15, 2019 02:27 AM)vorticalbox Wrote: doesn't it all ready have it as json? which you can access via .json() Yes, it does have it as JSON but JSON parsing is slow. Here's example running 1000000 iterations: ![]() Code that ran (Click to View) RE: Twitch ban checker (Multi-threaded) - vorticalbox - Jul 15, 2019 (Jul 15, 2019 02:56 AM)Kallu609 Wrote: Yes, it does have it as JSON but JSON parsing is slow. fair enough I thought the request library already did the json.parse for you 👍 |