(13 March, 2022 - 02:29 AM)FortniteSucks Wrote: Show MoreThank you so much for your time, I have gone through and looked at all of these libraries, but I would have no idea where to start to implement this stuff. I am just not experienced enough yet. I understand everything your saying in the second paragraph but the first and third I just don't understand everything you're saying. I know this is a lot to ask, but could you maybe dumb it down a bit?
In that case, I would focus on just running in parallel, and don't worry about asynchronous processing.
In my first paragraph, I'm just saying you will probably want to use the requests module. There are other modules you can use, but requests is the most common and it's able to handle proxies with or without authentication. If you don't have it installed, you can install it with
pip install requests. To work with socks proxies you will need an additional module, and will need to run
pip install requests[socks] .
In code, the usage is as follows:
Code:
import requests
# myHttpProxies = {'http':'http://user:pass@host:port', 'https':'http://user:pass@host:port')}
mySocksProxies = {'http':'socks5://user:pass@host:port', 'https':'socks5://user:pass@host:port')}
resp = requests.get('http://yoursite.com', proxies=mySocksProxies)
if resp.ok:
print(resp.text)
In paragraph 3 - I'm saying you should be using parallel processing. Instead of having a for loop iterating over each account and checking sequentially, you want to divide the workload so multiple accounts can be checked at the same time.
For example with a normal request to check one account, the round trip might take half a second without a proxy, but with a proxy it might take 2 seconds. Let's say you have 10 accounts to check.
- If you were to make 10 requests in parallel using proxies, you would get all responses back in 2 seconds.
- If you were to loop through these sequentially without a proxy, it would take 5 seconds.
- If you were to execute sequentially with proxies, it would take 20 seconds.
There are a few ways to implement parallelism in your code. You can use the built-in libraries such as
multiprocessing, or the thread module for
multithreading, but I recommend using
joblib since it has support for different backends (ie multiprocessing, threads, and more).
Hope this clarifies my earlier post.