diff --git a/bot/core/tapper.py b/bot/core/tapper.py index d22d5df..c497d9b 100644 --- a/bot/core/tapper.py +++ b/bot/core/tapper.py @@ -1,4 +1,4 @@ -import asyncio +import asyncio, random from time import time from random import randint from datetime import datetime @@ -472,7 +472,13 @@ async def run(self, proxy: str | None): continue http_client.headers["Authorization"] = f"Bearer {access_token}" - + ip="%s.%s.%s.%s"%(random.randint(1,225),random.randint(1,225),random.randint(1,225),random.randint(1,225)) + http_client.headers['X-Forwarded-For'] = ip + http_client.headers['X-Forwarded-Host']= ip + http_client.headers['X-Client-IP'] = ip + http_client.headers['X-Remote-IP'] = ip + http_client.headers['X-Remote-Addr'] = ip + http_client.headers['X-Host'] = ip access_token_created_time = time() await self.get_telegram_me(http_client=http_client) @@ -705,6 +711,13 @@ async def run(self, proxy: str | None): raise error else: logger.error(f"{self.session_name} | ⚠ Warning! Invalid protocol detected in {error}") + ip="%s.%s.%s.%s"%(random.randint(1,225),random.randint(1,225),random.randint(1,225),random.randint(1,225)) + http_client.headers['X-Forwarded-For'] = ip + http_client.headers['X-Forwarded-Host']= ip + http_client.headers['X-Client-IP'] = ip + http_client.headers['X-Remote-IP'] = ip + http_client.headers['X-Remote-Addr'] = ip + http_client.headers['X-Host'] = ip await asyncio.sleep(delay=randint(a=3, b=7)) except InvalidSession as error: