(self, function_to_call_for_appling_proxy)
| 32 | self._IP = random.choice(ipdata.split(",")) |
| 33 | |
| 34 | def __call__(self, function_to_call_for_appling_proxy): |
| 35 | SOCKS5_PROXY_HOST = self._IP |
| 36 | # default_socket = socket.socket |
| 37 | socks.set_default_proxy( |
| 38 | socks.SOCKS5, |
| 39 | SOCKS5_PROXY_HOST, |
| 40 | config.SOCKS5_PROXY_PORT, |
| 41 | True, |
| 42 | config.auth, |
| 43 | config.passcode, |
| 44 | ) |
| 45 | socket.socket = socks.socksocket |
| 46 | |
| 47 | def wrapper_function(url): |
| 48 | # this is used for applyting socks5 proxy over the request |
| 49 | return function_to_call_for_appling_proxy(url) |
| 50 | |
| 51 | socks.set_default_proxy() |
| 52 | return wrapper_function |
| 53 | |
| 54 | |
| 55 | async def dataprocess(htmldata): |
nothing calls this directly
no outgoing calls
no test coverage detected