Code Monkey home page Code Monkey logo

remoteauthclient's Introduction

RemoteAuthClient

Due to lack of time, I unfortunately cannot maintain RemoteAuthClient (including the captcha solving). For now, I will not archive the repository, so if a fix to the captcha problem appears, you can create a pull request.

Installing

Python 3.7 or higher is required

pip install remoteauthclient

Example

from asyncio import run
from remoteauthclient import RemoteAuthClient

c = RemoteAuthClient()

@c.event("on_fingerprint")
async def on_fingerprint(data):
    print(f"Fingerprint: {data}")
    print(f"QrCode url: https://api.qrserver.com/v1/create-qr-code/?size=256x256&data={data}")

@c.event("on_userdata")
async def on_userdata(user):
    print(f"ID: {user.id}")
    print(f"Username: {user.username}")
    print(f"Discriminator: {user.discriminator}")
    print(f"Avatar hash: {user.avatar}")
    print(f"Name: {user.getName()}")
    print(f"Avatar URL: {user.getAvatarURL()}")

@c.event("on_token")
async def on_token(token):
    print(f"Token: {token}")

@c.event("on_cancel")
async def on_cancel():
    print(f"Auth canceled!")

@c.event("on_timeout")
async def on_timeout():
    print(f"Timeout")

@c.event("on_captcha")
async def on_captcha(captcha_data):
    # captcha_data contains captcha_sitekey, captcha_service (hcaptcha), captcha_rqdata and captcha_rqtoken
    print(f"Captcha!")
    captcha_key = ... # Solve captcha and get captcha_key, you must provide captcha_sitekey and captcha_rqdata to solving service
    return captcha_key

@c.event("on_error")
async def on_error(exc, client):
    print(f"Error: {exc.__class__.__name__}")
    if client.retries == 1:
        await client.run_task()

run(c.run())

Proxy example

from remoteauthclient import RemoteAuthClient

c = RemoteAuthClient(proxy="127.0.0.1:8080")
# Or with auth
c = RemoteAuthClient(proxy="127.0.0.1:8080", proxy_auth={"login": "user", "password": "password"})

...

remoteauthclient's People

Contributors

ruslanuc avatar what-xd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

remoteauthclient's Issues

replit.com

can you maybe make a replit.com link with a working QR bot?

Unable to get a token.

Использую такой код:

c = RemoteAuthClient(proxy="[ТУТ ПРОКСИ:ПОРТ]", proxy_auth={"login": "vzukrqaa", "password": "wqdxoszo"})

....

@c.event("on_captcha")
async def on_captcha(captcha_data):

msg_captha = await call.message.answer("<b>♻️ Подождите, мы проходим капчу</b>")

solver = hCaptchaProxyon()
    solver.set_verbose(1)
    solver.set_key("[KEY САЙТА]")
    solver.set_website_url("https://discord.com/login")
    solver.set_website_key(captcha_data["captcha_sitekey"])
    solver.set_proxy_address("[ТУТ ПРОКСИ]")
    solver.set_proxy_port(10941)
    solver.set_proxy_login("vzukrqaa")
    solver.set_proxy_password("wqdxoszo")
    solver.set_user_agent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36")
    solver.set_enterprise_payload({"rqdata": captcha_data["captcha_rqdata"]})
    g_response = solver.solve_and_return_solution()
    print(g_response)
    return g_response

...

await c.run()

Получаю ошибку: Unable to get a token.
ОС: Windows 11
Python: 3.10.0

P.S. Пишу Telegram бота на Aiogram
P.S. Знаю что использываю несинхронную библиотеку для решении капчи, сделано это для теста (Не хочу переделывать на aiohttp) + думаю что она не будет мешать тестам

aiohttp.client_exceptions.ClientOSError: [WinError 121] Превышен таймаут семафора

aiohttp.client_exceptions.ClientOSError: [WinError 121] Превышен таймаут семафора
Я погуглил и ничего не нашел по этому поводу, есть ли какой то фикс? (Ошибка возникает после решение капчи)

    ```

@c.event("on_captcha")
async def on_captcha(captcha_data):
# captcha_data contains captcha_sitekey, captcha_service (hcaptcha), captcha_rqdata and captcha_rqtoken
print(f"Captcha!")
solver = hCaptchaProxyless()
solver.set_verbose(1)
solver.set_key("3ae39105dbb97c5c01522b940547b2b6") # Ваш ключ
solver.set_website_url("https://discord.com/login")
solver.set_website_key(captcha_data['captcha_sitekey'])
solver.set_user_agent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36")
solver.set_is_invisible(1)
solver.set_enterprise_payload({"rqdata": captcha_data["captcha_rqdata"], "sentry": True})
result = solver.solve_and_return_solution()
g_response = solver.solve_and_return_solution()
if g_response != 0:
print("g-response: "+g_response)
print("user-agent: "+solver.get_user_agent())

        return result

Proxy Error

https://hastebin.com/beyujumetu.py

I know that I am not really solving the captcha,
but I am getting errors at the first line!

Traceback (most recent call last):
File "c:\Users\Not revealing my user name\remoteauthclient\main.py", line 4, in
c = RemoteAuthClient(proxy="127.0.0.1:8080")
TypeError: init() got an unexpected keyword argument 'proxy'

RUCaptcha

Как юзать вместе с RAC(RemoteAuthClient)?

Я использую библу twocaptcha
Но не понимаю как ее соединить с @c.event("on_captcha")

Сейчас я юзаю такой код:

				@c.event("on_captcha")
				async def on_captcha(captcha_data):
					print("Captcha!")
					try:
						result = solver.hcaptcha(sitekey=sitekey,
						  url='https://www.discord.com/login/')
						balance = solver.balance()
						print(balance)
						return result
					except Exception as err:
						print(err)
						

error in "pending_login"

Task exception was never retrieved
future: <Task finished name='Task-23' coro=<start..verification_callback..RemoteAuthClient.run() done, defined at c:\main.py:132> exception=AssertionError()>
Traceback (most recent call last):
File "c:\main", line 170, in run
assert resp.status == 200
AssertionError

Error!

--- Logging error ---
Traceback (most recent call last):
File "C:\Users\wes23\AppData\Local\Programs\Python\Python310\lib\logging_init_.py", line 1100, in emit
msg = self.format(record)
File "C:\Users\wes23\AppData\Local\Programs\Python\Python310\lib\logging_init_.py", line 943, in format
return fmt.format(record)
File "C:\Users\wes23\AppData\Local\Programs\Python\Python310\lib\logging_init_.py", line 678, in format
record.message = record.getMessage()
File "C:\Users\wes23\AppData\Local\Programs\Python\Python310\lib\logging_init_.py", line 368, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "C:\Users\wes23\Desktop\main.py", line 321, in
Init()
File "C:\Users\wes23\Desktop\main.py", line 104, in Init
bot.run(botToken)
File "C:\Users\wes23\AppData\Local\Programs\Python\Python310\lib\site-packages\nextcord\client.py", line 853, in run
loop.run_forever()
File "C:\Users\wes23\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
super().run_forever()
File "C:\Users\wes23\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 600, in run_forever
self._run_once()
File "C:\Users\wes23\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1896, in _run_once
handle._run()
File "C:\Users\wes23\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\wes23\AppData\Local\Programs\Python\Python310\lib\site-packages\remoteauthclient\remoteauthclient.py", line 232, in _run
log.error("RemoteAuthClient disconnected with error.", err)
Message: 'RemoteAuthClient disconnected with error.'
Arguments: (ConnectionClosedError(Close(code=4001, reason='Decode Error'), Close(code=4001, reason='Decode Error'), True),)

captcha solve

How can I solve captcha with my capmonster cloud? im a newb

How to fix this?

Captcha!
Task exception was never retrieved
future: <Task finished name='Task-177' coro=<RemoteAuthClient.run() done, defined at C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\remoteauthclient\remoteauthclient.py:196> exception=WebDriverException("'chromedriver.exe' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home")>
Traceback (most recent call last):
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\common\service.py", line 71, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] Не удается найти указанный файл

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\remoteauthclient\remoteauthclient.py", line 199, in run
await self._task
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\remoteauthclient\remoteauthclient.py", line 181, in _run
encryptedToken = await self._getToken(p["ticket"])
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\remoteauthclient\remoteauthclient.py", line 138, in _getToken
captcha_key = await self._event("captcha", captcha_data=j)
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\remoteauthclient\remoteauthclient.py", line 105, in _event
return await handler(**kwargs)
File "C:\Users\Hp\Desktop\bot\bot-main\main.py", line 141, in on_captcha
captcha_key = await solver.solve(custom_params={"rqdata": captcha_data["captcha_rqdata"]})
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\async_hcaptcha\asynchcaptcha.py", line 375, in solve
"n": await self._getN(),
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\async_hcaptcha\asynchcaptcha.py", line 130, in _getN
return await self._solve_hsw(d['l'])
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\async_hcaptcha\asynchcaptcha.py", line 153, in _solve_hsw
return await get_event_loop().run_in_executor(ThreadPoolExecutor(4), _hsw)
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\async_hcaptcha\asynchcaptcha.py", line 148, in _hsw
driver = Chrome(service=Service(**self.chromedriver_args), options=options)
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 70, in init
super(WebDriver, self).init(DesiredCapabilities.CHROME['browserName'], "goog",
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 89, in init
self.service.start()
File "C:\Users\Hp\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home

Hello there, I still have the same issue.

Hello, I was wondering if there's any way you can send me the updated main.py file? Since I'm kinda new at this. I tried looking at other issues and seeing if I could resolve them by seeing what you said, but none of them worked. I don't know if I did it correctly or if it stopped working.

Как исправить ошибку "invalid response"

Мне постоянно в ответе выдает такую ошибку:
json {'captcha_key': ['invalid-response'], 'captcha_sitekey': 'a9b5fb07-92ff-493f-86fe-352a2803b3df', 'captcha_service': 'hcaptcha', 'captcha_rqdata': '***', 'captcha_rqtoken': '***'}
Что с этим можно сделать?

Использую для решения https://capmonster.cloud/

Please Help

So, I used to use a fake qr code token grabber thingy by Astraadev, and, it doesn't work anymore since the qr codes do not generate anymore because of hCaptcha.
Anyone got a qr code token grabber that works?

dm me on discord if you do or respond here: f4a#3954

How captcha work?

image

You have captcha function and what is captcha_sitekey, captcha_service, captcha_rqdata, captcha_rqtoken, captcha_key, captcha_sitekey

Captcha solving

Hello! When i try to grab token, instead of encrypted_token i get captcha. Will there be an update soon to solve this problem?

Unable to get a token

Could someone help with this? i keep on getting this error , and it seems to come from the remoteauthclient

Unable to get a token after solving captcha

Doesn't work even after solving captcha (did with 2captcha) Console returns unable to get a token.
This error come from remoteauthclient, tried using different private proxies on remoteauthclient+captcha solver.
Still same error

Attributerror: self-_heartbeatTask has no attribute cancel()

Hello, a few weeks ago this code have worked fine, i don't think i changed anything on my side. This error happen when the QR Code should be generated. Seems like self-_heartbeatTask is somehow defined with None.

Anyone may got a solution for this issue?

class RemoteAuthClient:
    def __init__(self):
        self.initCrypto()
        self._heartbeatTask = None
        self.on_fingerprint = self.ev
        self.on_userdata = self.ev
        self.on_token = self.ev
        self.on_cancel = self.ev
        self.on_timeout = self.ev

if p["op"] == "hello":
    await self.send({"op": "init", "encoded_public_key": self.publicKeyString}, ws)
    self._heartbeatTask = asyncio.get_event_loop().create_task(self.sendHeartbeat(p["heartbeat_interval"], ws))

self._heartbeatTask.cancel()

Обход каптчи не работает

Можем пойти в дискорд для более простого общения? Nice🌙#1052
А так кратко:
С помощью AioHcaptcha получаю ключ каптчи и отправляю в реквест, но выдает ошибку 400.

unable to get token

it stopped working
A couple of days ago everything was working, and then 4 days ago I noticed that the tokens stopped coming

Всегда ошибка "Unable to get a token"

Когда пользователь сканирует код и нажимает да, показывается текст Unable to get a token. Если сканирую я, со своего аккаунта, всё работает нормально

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.