Getting 407 Error but my proxies 100% fine
Archiviert 6 months ago
O
stoicism abuser
Verified
Hello! I'm trying to get access to API but can't understand what's problem with 407 ERROR.
My proxies 100% correct cause i get cookies with them.
Tell me, maybe i'm missing some requests?
```PROXY_CONFIGS = [
{
"name": "IPRoyal Korea Residential",
"proxy": "geo.iproyal.com:51204",
"auth": "MYPROXYINFO",
"location": "South Korea",
"provider": "iproyal",
}
]
def get_proxy_config(proxy_info):
proxy_url = f"http://{proxy_info['auth']}@{proxy_info['proxy']}"
logger.info(f"Proxy being used: {proxy_url}")
return {
"http": proxy_url,
"https": proxy_url
}
USER_AGENTS = [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.6422.113 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 13_5_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.6367.78 Safari/537.36",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.6422.61 Safari/537.36",
]
BASE_HEADERS = {
"accept": "application/json, text/javascript, */*; q=0.01",
"accept-language": "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7",
"origin": "http://www.encar.com",
"referer": "http://www.encar.com/",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"priority": "u=1, i",
}
def get_dynamic_headers():
ua = random.choice(USER_AGENTS)
headers = BASE_HEADERS.copy()
headers["user-agent"] = ua
headers["sec-ch-ua"] = '"Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"'
headers["sec-ch-ua-mobile"] = "?0"
headers["sec-ch-ua-platform"] = '"Windows"'
return headers
last_request_time = 0
async def rate_limit(min_interval=0.5):
global last_request_time
now = time.time()
if now - last_request_time < min_interval:
await asyncio.sleep(min_interval - (now - last_request_time))
last_request_time = time.time()
```
there's more but discord limits
