Giter Club home page Giter Club logo

vinyzu / botright Goto Github PK

View Code? Open in Web Editor NEW
398.0 9.0 54.0 54.53 MB

Botright, the most advance undetected, fingerprint-changing, captcha-solving, open-source automation framework. Build on Playwright, its as easy to use as it is to extend your code. Solving your Captchas for free with AI.

License: GNU General Public License v3.0

Python 96.31% JavaScript 0.56% CSS 0.01% HTML 3.13%
ai automation bots botting browser captcha captcha-solver captcha-solving chrome chromium

botright's Introduction

Typing SVG

I'm mostly interested in Botting!

IΒ write all my Bots in Python,
but i'm also learning HTML, CSS 
and a little bit of Javascript.
Learn more about me:

Discord Presence

Coding πŸͺ„
import the_best as Vinyzu

class Coding(Vinyzu):
    def __init__(self):
        super.__init__()
    
    def languages(self):
        self.expert = ("Python", "HTML", "CSS")
        self.intermediate = "Javascript"
        self.beginner = "C++"

    def interests(self):
        self.enviroment = ("PyCharm", "VSCode")
        self.specialities = ("Automation", "Botting", "Obfuscation", "Scraping")     

    def projects(self):
        self.current = ("Botright", "reCognizer")
        self.automation = ("chrome-fingerprints", "reCognizer")
        self.discord = ("Discord Browser Generator", "Tokify (Early Versions)", "Promo Redeemer v1/v2", "Booster")
        self.twitch = "Auto Registrator"
        self.music = ("Spotify", "Tidal", "Deezer", "Youtube Music", "Soundcloud", "Amazon Music")
        self.hcaptcha = ("Bypass", "HSW Generator")
Myself πŸ™‹β€β™‚οΈ
from vinyzu import Person
import world_wide_web as www

class Myself(Person):
    def __init__(self):
        super.__init__()
    
    def life(self):
        self.age = 18
        self.languages = ["English", "German"]
        self.location = www.Internet
        self.fun_fact = "My first freelancing job was automating invoices for animal foods."

    def contact(self):
        self.discord = "@vinyzu"
        self.server = "https://discord.gg/FTcnNHkqa7"
        self.donations = "https://ko-fi.com/vinyzu"
        self.freelancing = self.discord
        self.collaborations = self.discord

Readme inspired by xTekky

botright's People

Contributors

dependabot[bot] avatar gandag avatar vinyzu avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

botright's Issues

[Question] How to give user data directory

I want to add the user data directory to my program. I tried to define user directory like playwright but it didn't work out. Is there any way to give user data directory?

[BUG]

Describe the bug
Google pages don't load with proxies. And if I open a new tab manually from the same browser, the page will load normally. The problem is clearly not in my proxies.

Code Sample

import asyncio
import botright


async def main():
    botright_client = await botright.Botright()
    browser = await botright_client.new_browser(
        proxy="user:pass@ip:port",
    )
    page = await browser.new_page()
    await page.goto("https://www.myip.com")  # loads

    page = await browser.new_page()
    await page.goto("https://accounts.google.com")  # fails to load!!!
    await page.wait_for_timeout(5000)
    await botright_client.close()

if __name__ == "__main__":
    asyncio.run(main())

Screenshots
image

Desktop:

  • Windows 11

[BUG] RuntimeError: Event loop is closed, ValueError: I/O operation on closed pipe

Hello!
Thank you for sharing this!

I'm tried sample code on docs. But getting

2023-11-04 16:01:45,483 ERROR Task exception was never retrieved
future: <Task finished name='Task-68' coro=<Response.finished.<locals>.on_finished() done, defined at C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\playwright\_impl\_network.py:544> exception=Error('Target closed')>
Traceback (most recent call last):
  File "C:\Users\Administrator\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\playwright\_impl\_network.py", line 546, in on_finished
    raise Error("Target closed")
playwright._impl._api_types.Error: Target closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001CF603689A0>
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\proactor_events.py", line 116, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\proactor_events.py", line 80, in __repr__
    info.append(f'fd={self._sock.fileno()}')
                      ^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\windows_utils.py", line 102, in fileno
    raise ValueError("I/O operation on closed pipe")
ValueError: I/O operation on closed pipe
Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x000001CF6033F240>
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_subprocess.py", line 125, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_subprocess.py", line 70, in __repr__
    info.append(f'stdin={stdin.pipe}')
                ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\proactor_events.py", line 80, in __repr__
    info.append(f'fd={self._sock.fileno()}')
                      ^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\windows_utils.py", line 102, in fileno
    raise ValueError("I/O operation on closed pipe")
ValueError: I/O operation on closed pipe
Exception ignored in: <function StreamWriter.__del__ at 0x000001CF60323EC0>
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\streams.py", line 395, in __del__
    self.close()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\streams.py", line 343, in close
    return self._transport.close()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\proactor_events.py", line 109, in close
    self._loop.call_soon(self._call_connection_lost, None)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 761, in call_soon
    self._check_closed()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 519, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

I'm using Windows 11 and 3.11.6

Thank you

[BUG] IndexError: list index out of range

Describe the bug
It can't index the list and save the content in the image_url variable

Code Sample

 Error:
 Traceback (most recent call last):
  File "C:\Users\Administrator\Desktop\DISLOCK V2\main.py", line 109, in generate_unclaimed
    await self.page.solve_hcaptcha()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\playwright_mock\page.py", line 334, in solve_mocker
    return await hcaptcha.hCaptcha.solve_hcaptcha(page, rqdata=rqdata)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\hcaptcha.py", line 189, in solve_hcaptcha
    return await hCaptcha.solve_captcha(page, checkbox)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\hcaptcha.py", line 102, in solve_captcha
    image_url = style.split('url("')[1].split('"')[0]
IndexError: list index out of range

To Reproduce
Steps to reproduce the behavior:

  1. Run the main.py file
  2. Wait until Browser is spawned
  3. Notice the error i sent above
  4. This error happen in the botright liebary so i'm asking here

Expected behavior
Code should work i guess :)

Desktop (please complete the following information):

  • OS: Windows
  • Version 10

Error while installing botright (with pip) [BUG]

Command: "pip install botright"

Output:

Collecting botright
Using cached botright-0.5.1-py3-none-any.whl.metadata (11 kB)
Collecting async-class (from botright)
Using cached async-class-0.5.0.tar.gz (5.4 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: httpx>=0.24.1 in c:\users\fontr\appdata\local\programs\python\python312\lib\site-packages (from botright) (0.27.0)
Collecting playwright>=1.40.0 (from botright)
Using cached playwright-1.43.0-py3-none-win_amd64.whl.metadata (3.5 kB)
Collecting undetected-playwright-patch (from botright)
Using cached undetected_playwright_patch-1.40.0.post1700587210000-py3-none-win_amd64.whl.metadata (5.5 kB)
Collecting pybrowsers>=0.5.2 (from botright)
Using cached pybrowsers-0.5.2-py3-none-any.whl.metadata (7.9 kB)
Collecting chrome-fingerprints (from botright)
Using cached chrome_fingerprints-1.1-py3-none-any.whl.metadata (3.2 kB)
Collecting numpy (from botright)
Using cached numpy-1.26.4-cp312-cp312-win_amd64.whl.metadata (61 kB)
Collecting hcaptcha-challenger>=0.10.1.post1 (from botright)
Using cached hcaptcha_challenger-0.10.1.post2-py3-none-any.whl.metadata (7.5 kB)
Collecting recognizer (from botright)
Using cached recognizer-1.4-py3-none-any.whl.metadata (5.4 kB)
Requirement already satisfied: setuptools in c:\users\fontr\appdata\local\programs\python\python312\lib\site-packages (from botright) (69.5.1)
Requirement already satisfied: loguru in c:\users\fontr\appdata\local\programs\python\python312\lib\site-packages (from botright) (0.7.2)
Collecting ftfy (from hcaptcha-challenger>=0.10.1.post1->botright)
Using cached ftfy-6.2.0-py3-none-any.whl.metadata (7.3 kB)
Collecting importlib_metadata (from hcaptcha-challenger>=0.10.1.post1->botright)
Using cached importlib_metadata-7.1.0-py3-none-any.whl.metadata (4.7 kB)
INFO: pip is looking at multiple versions of hcaptcha-challenger to determine which version is compatible with other requirements. This could take a while.
Collecting hcaptcha-challenger>=0.10.1.post1 (from botright)
Using cached hcaptcha_challenger-0.10.1.post1-py3-none-any.whl.metadata (7.5 kB)
Collecting botright
Using cached botright-0.5-py3-none-any.whl.metadata (11 kB)
Using cached botright-0.4.post1-py3-none-any.whl.metadata (10 kB)
Collecting playwright==1.37.0 (from botright)
Using cached playwright-1.37.0-py3-none-win_amd64.whl.metadata (3.5 kB)
Collecting playwright-stealth==1.0.6 (from botright)
Using cached playwright_stealth-1.0.6-py3-none-any.whl.metadata (2.2 kB)
Collecting fake-useragent==1.3.0 (from botright)
Using cached fake_useragent-1.3.0-py3-none-any.whl.metadata (13 kB)
Collecting numpy==1.26.0 (from botright)
Using cached numpy-1.26.0-cp312-cp312-win_amd64.whl.metadata (61 kB)
Collecting scipy==1.11.2 (from botright)
Using cached scipy-1.11.2-cp312-cp312-win_amd64.whl.metadata (59 kB)
Collecting Pillow==10.0.1 (from botright)
Using cached Pillow-10.0.1-cp312-cp312-win_amd64.whl.metadata (9.6 kB)
Collecting yolov5==7.0.12 (from botright)
Using cached yolov5-7.0.12-py37.py38.py39.py310-none-any.whl.metadata (10 kB)
Collecting sentence-transformers (from botright)
Using cached sentence_transformers-2.7.0-py3-none-any.whl.metadata (11 kB)
Collecting easyocr==1.7.1 (from botright)
Using cached easyocr-1.7.1-py3-none-any.whl.metadata (11 kB)
Collecting Faker==19.6.1 (from botright)
Using cached Faker-19.6.1-py3-none-any.whl.metadata (15 kB)
Collecting scikit-image==0.21.0 (from botright)
Using cached scikit_image-0.21.0.tar.gz (22.7 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

Γ— Preparing metadata (pyproject.toml) did not run successfully.
β”‚ exit code: 1
╰─> [21 lines of output]
+ meson setup C:\Users\fontr\AppData\Local\Temp\pip-install-vg43ouos\scikit-image_06f87b8af80542af9af1a1bc88acd54a C:\Users\fontr\AppData\Local\Temp\pip-install-vg43ouos\scikit-image_06f87b8af80542af9af1a1bc88acd54a.mesonpy-geb01ezq -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\fontr\AppData\Local\Temp\pip-install-vg43ouos\scikit-image_06f87b8af80542af9af1a1bc88acd54a.mesonpy-geb01ezq\meson-python-native-file.ini
The Meson build system
Version: 1.4.0
Source dir: C:\Users\fontr\AppData\Local\Temp\pip-install-vg43ouos\scikit-image_06f87b8af80542af9af1a1bc88acd54a
Build dir: C:\Users\fontr\AppData\Local\Temp\pip-install-vg43ouos\scikit-image_06f87b8af80542af9af1a1bc88acd54a.mesonpy-geb01ezq
Build type: native build
Project name: scikit-image
Project version: 0.21.0
WARNING: Failed to activate VS environment: Could not find C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe

  ..\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']]
  The following exception(s) were encountered:
  Running `icl ""` gave "[WinError 2] Das System kann die angegebene Datei nicht finden"
  Running `cl /?` gave "[WinError 2] Das System kann die angegebene Datei nicht finden"
  Running `cc --version` gave "[WinError 2] Das System kann die angegebene Datei nicht finden"
  Running `gcc --version` gave "[WinError 2] Das System kann die angegebene Datei nicht finden"
  Running `clang --version` gave "[WinError 2] Das System kann die angegebene Datei nicht finden"
  Running `clang-cl /?` gave "[WinError 2] Das System kann die angegebene Datei nicht finden"
  Running `pgcc --version` gave "[WinError 2] Das System kann die angegebene Datei nicht finden"

  A full log can be found at C:\Users\fontr\AppData\Local\Temp\pip-install-vg43ouos\scikit-image_06f87b8af80542af9af1a1bc88acd54a\.mesonpy-geb01ezq\meson-logs\meson-log.txt
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Γ— Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[BUG] Solving Captcha - RuntimeError: Event loop is closed

Describe the bug
After the browser open and click the captcha checkbox so that the images appear, it stop do anything and after a while it close the browser along with some tracebacks.

Code Sample

import asyncio
import botright

async def main():
    botright_client = await botright.Botright(headless=False)
    browser = await botright_client.new_browser()
    page = await browser.new_page()

    tkn = await browser.get_hcaptcha()
    print("tkn: ", tkn)
    page.goto("http://discord.com/")
    page.screenshot(path="example.png")

    await botright_client.close()

if __name__ == "__main__":
    asyncio.run(main())

To Reproduce
Steps to reproduce the behavior:

  1. create a new main.py file with the sample code above
  2. install latest botright version
  3. run main.py file
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
https://i.imgur.com/aQBPSap.png

Desktop (please complete the following information):

  • OS: Windows
  • Version 10

Additional context

C:\Users\admin\Downloads\testpy\captcha>python main.py
C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
  warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
Traceback (most recent call last):
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\site-packages\botright\modules\hcaptcha.py", line 134, in solve_captcha
    style = await sub_element.get_attribute("style")
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\async_api\_generated.py", line 14363, in get_attribute
    await self._impl_obj.get_attribute(name=name, timeout=timeout)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\_impl\_locator.py", line 337, in get_attribute
    return await self._frame.get_attribute(
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\_impl\_frame.py", line 613, in get_attribute
    return await self._channel.send("getAttribute", locals_to_params(locals()))
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\_impl\_connection.py", line 43, in send
    return await self._connection.wrap_api_call(
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\_impl\_connection.py", line 396, in wrap_api_call
    return await cb()
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\_impl\_connection.py", line 78, in inner_send
    result = next(iter(done)).result()
playwright._impl._api_types.TimeoutError: Timeout 30000ms exceeded.
=========================== logs ===========================
  waiting for frame "xpath=//iframe[contains(@title,'content')] >> nth=0"
  selector resolved to visible <iframe scrolling="no" frameborder="0" title="Main conte…></iframe>
waiting for selector "//iframe[contains(@title,'content')] >> nth=0 >> internal:control=enter-frame >> //div[@class='task-image'] >> nth=0 >> [class="image-wrapper"] >> [class="image"]"
============================================================

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\admin\Downloads\testpy\captcha\main.py", line 18, in <module>
    asyncio.run(main())
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "C:\Users\admin\Downloads\testpy\captcha\main.py", line 10, in main
    tkn = await browser.get_hcaptcha()
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\site-packages\botright\modules\playwright_mock\browser.py", line 16, in get_hcaptcha_mocker
    return await hcaptcha.hCaptcha.get_hcaptcha(browser, sitekey=sitekey, rqdata=rqdata)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\site-packages\botright\modules\hcaptcha.py", line 215, in get_hcaptcha
    return await page.solve_hcaptcha(rqdata=rqdata)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\site-packages\botright\modules\playwright_mock\page.py", line 343, in hcap_solve_mocker
    return await hcaptcha.hCaptcha.solve_hcaptcha(page, rqdata=rqdata)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\site-packages\botright\modules\hcaptcha.py", line 210, in solve_hcaptcha
    return await hCaptcha.solve_captcha(page, checkbox)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\site-packages\botright\modules\hcaptcha.py", line 137, in solve_captcha
    raise TimeoutError("Captcha Images didnt load")
TimeoutError: Captcha Images didnt load
Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x00000251A74A98B0>
Traceback (most recent call last):
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_subprocess.py", line 126, in __del__
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_subprocess.py", line 104, in close
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 510, in _check_closed
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000251A74D61F0>
Traceback (most recent call last):
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 116, in __del__
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 510, in _check_closed
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000251A74D61F0>
Traceback (most recent call last):
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 116, in __del__
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 510, in _check_closed
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000251A74D61F0>
Traceback (most recent call last):
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 116, in __del__
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 510, in _check_closed
RuntimeError: Event loop is closed
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x00000251A74D61F0>
Traceback (most recent call last):
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 116, in __del__
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon
  File "C:\Users\admin\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 510, in _check_closed
RuntimeError: Event loop is closed

[BUG] waiting for frame_locator("xpath=//iframe[contains(@title, 'hCaptcha challenge')]").locator("xpath=//div[@class='challenge-view']//canvas")

import asyncio

import botright


async def main():
    botright_client = await botright.Botright()
    browser = await botright_client.new_browser()
    page = await browser.new_page()

    # Continue by using the Page
    await page.goto("https://accounts.hcaptcha.com/demo")
    await page.solve_hcaptcha()
    await page.wait_for_timeout(100000 * 10000)
if __name__ == "__main__":
    asyncio.run(main()) 

I'm getting
waiting for frame_locator("xpath=//iframe[contains(@title, 'hCaptcha challenge')]").locator("xpath=//div[@Class='challenge-view']//canvas")
so often. Is there a way to fix it?

Proxies dont working (browser not start) [BUG]

Describe the bug
Im trying to use my proxies and is getting some errors, take a look how im trying to start my browser

Code Sample
proxy_settings = {
'server': 'http://pr.oxylabs.io:7777',
'username': 'customer-lol',
'password': 'pass'
}

botright_client = await botright.Botright(use_undetected_playwright=True, spoof_canvas=True)
browser = await botright_client.new_browser(proxy=proxy_settings)
page = await browser.new_page()

Desktop (please complete the following information):

  • OS: Win 10

[BUG] cannot import name 'keras' from 'tensorflow' (unknown location) or No module named 'tensorflow.compat'

Describe the bug
When I import botright, I have the first error :

cannot import name 'keras' from 'tensorflow' (unknown location)

so I look at the error, and I see in recaptcha.py in botright that you import keras from tensorflow, so I change it to import only keras cause it can be an alone lib. WhenI do that, I have another error,

 No module named 'tensorflow.compat'

this error come from the keras engine, so don't think you can do a lot about the second error, but maybe the first

Code Sample

import botright

To Reproduce
Steps to reproduce the behavior:

  1. Import botright

Expected behavior
Just import it :'D

Desktop (please complete the following information):

  • OS: Windows
  • Version: 10

Additional context

  • Python version: 3.10.0
  • Botright version: 3.2.2
  • Tensorflow version: 2.11.0

[BUG] Requirements conflicts

2024-03-20 14:14:33.383 [info] INFO: pip is looking at multiple versions of undetected-playwright-patch to determine which version is compatible with other requirements. This could take a while.
2024-03-20 14:14:33.419 [info] ERROR: Cannot install -r /Users/xxx/Desktop/dev/repos/Botright/requirements.txt (line 4) and -r /Users/xxx/Desktop/dev/repos/Botright/requirements.txt (line 5) because these package versions have conflicting dependencies.
2024-03-20 14:14:33.419 [info] 
The conflict is caused by:
    playwright 1.42.0 depends on greenlet==3.0.3
    undetected-playwright-patch 1.40.0.post1700587210000 depends on greenlet==3.0.1

There's a conflict between playwright and undetected-playwright-patch regarding greenlet.
This is caused by https://github.com/kaliiiiiiiiii/undetected-playwright-python/blob/8886a371b5758dc59026c5fc0e8735ef8b754427/setup.py#L228

    install_requires=[
        "greenlet==3.0.1",
        "pyee==11.0.1",
        "typing-extensions;python_version<='3.8'",
    ],

I don't really know where to address this issue as it comes from kaliiiiiiiiii repo, but your requirements are then, triggering the conflict.

Fingerprint API - BrowserForge

https://github.com/daijro/browserforge

Currently, I found a new project from a guy that uses an API from apify to get some fingerprints, adding this to botright can save a lot of time from people getting time lost trying to dump some fingerprints by own (I know, you already have an fingerprint generator and botright is using it, but have a time since you dumped some fingerprints for you own library)

[BUG] Currently I am getting an error after solving recaptcha

Describe the bug
After recaptcha is solved successfully I am getting the following exception:

playwright._impl._errors.Error: ReferenceError: grecaptcha is not defined
    at eval (eval at evaluate (:226:30), <anonymous>:1:1)
    at eval (<anonymous>)
    at UtilityScript.evaluate (<anonymous>:226:30)
    at UtilityScript.<anonymous> (<anonymous>:1:44)

Code Sample

botright_client = await botright.Botright()
context = await botright_client.new_browser()
page = await context.new_page()
await page.goto('https://www.google.com')
await page.solve_recaptcha()

Desktop (please complete the following information):

  • OS: Ubuntu
  • Version 20.04

Additional context
Full traceback:

  File "/project_dir/botright_crawler/search_google.py", line 176, in <module>
    asyncio.run(main())
  File "/conda_env/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/conda_env/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/project_dir/botright_crawler/search_google.py", line 56, in main
    await captcha_watch(page)
  File "/project_dir/botright_crawler/search_google.py", line 38, in captcha_watch
    await page.solve_recaptcha()
  File "/conda_env/lib/python3.10/site-packages/botright/playwright_mock/page.py", line 248, in solve_recaptcha
    result: Union[str, bool] = await self.recaptcha_solver.solve_recaptcha()
  File "/conda_env/lib/python3.10/site-packages/recognizer/agents/playwright/async_control.py", line 163, in solve_recaptcha
    return await self.handle_recaptcha()
  File "/conda_env/lib/python3.10/site-packages/recognizer/agents/playwright/async_control.py", line 146, in handle_recaptcha
    return await self.handle_recaptcha()
  File "/conda_env/lib/python3.10/site-packages/recognizer/agents/playwright/async_control.py", line 146, in handle_recaptcha
    return await self.handle_recaptcha()
  File "/conda_env/lib/python3.10/site-packages/recognizer/agents/playwright/async_control.py", line 146, in handle_recaptcha
    return await self.handle_recaptcha()
  [Previous line repeated 2 more times]
  File "/conda_env/lib/python3.10/site-packages/recognizer/agents/playwright/async_control.py", line 138, in handle_recaptcha
    if captcha_token := await self.check_result():
  File "/conda_env/lib/python3.10/site-packages/recognizer/agents/playwright/async_control.py", line 52, in check_result
    captcha_token: str = await self.page.evaluate("grecaptcha.getResponse()")
  File "/conda_env/lib/python3.10/site-packages/playwright/async_api/_generated.py", line 8674, in evaluate
    await self._impl_obj.evaluate(
  File "/conda_env/lib/python3.10/site-packages/playwright/_impl/_page.py", line 391, in evaluate
    return await self._main_frame.evaluate(expression, arg)
  File "/conda_env/lib/python3.10/site-packages/playwright/_impl/_frame.py", line 272, in evaluate
    await self._channel.send(
  File "/conda_env/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 62, in send
    return await self._connection.wrap_api_call(
  File "/conda_env/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 492, in wrap_api_call
    return await cb()
  File "/conda_env/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 100, in inner_send
    result = next(iter(done)).result()
playwright._impl._errors.Error: ReferenceError: grecaptcha is not defined
    at eval (eval at evaluate (:226:30), <anonymous>:1:1)
    at eval (<anonymous>)
    at UtilityScript.evaluate (<anonymous>:226:30)
    at UtilityScript.<anonymous> (<anonymous>:1:44)

environment:

aiodns==3.1.1
aiohttp==3.9.1
aiomisc==17.3.41
aiosignal==1.3.1
annotated-types==0.6.0
anyio==4.2.0
async-class==0.5.0
async-timeout==4.0.3
attrs==22.2.0
Automat==22.10.0
botright==0.5
build==1.0.3
CacheControl==0.13.1
cachetools==5.3.2
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
chrome-fingerprints==1.1
cleo==2.1.0
click==8.1.7
coloredlogs==15.0.1
colorlog==6.8.2
constantly==23.10.4
contourpy==1.2.0
crashtest==0.4.1
cryptography==42.0.2
cssselect==1.2.0
cycler==0.12.1
dacite==1.8.1
distlib==0.3.8
dulwich==0.21.7
exceptiongroup==1.2.0
fake-useragent==1.4.0
fastjsonschema==2.19.1
filelock==3.13.1
flatbuffers==23.5.26
fonttools==4.48.1
frozenlist==1.4.1
fsspec==2024.2.0
ftfy==6.1.3
greenlet==3.0.1
h11==0.14.0
h2==4.1.0
hcaptcha-challenger==0.10.1.post2
hpack==4.0.0
httpcore==1.0.2
httpx==0.26.0
huggingface-hub==0.20.3
humanfriendly==10.0
hyperframe==6.0.1
hyperlink==21.0.0
idna==3.6
imageio==2.33.1
importlib-metadata==7.0.1
incremental==22.10.0
installer==0.7.0
itemadapter==0.8.0
itemloaders==1.1.0
jaraco.classes==3.3.0
jeepney==0.8.0
Jinja2==3.1.3
jmespath==1.0.1
joblib==1.3.2
keyring==24.3.0
kiwisolver==1.4.5
lazy_loader==0.3
logging-journald==0.6.7
loguru==0.7.2
lxml==5.1.0
MarkupSafe==2.1.5
matplotlib==3.8.2
maxminddb==2.5.2
more-itertools==10.2.0
mpmath==1.3.0
msgpack==1.0.7
multidict==6.0.5
networkx==3.2.1
numpy==1.26.4
nvidia-cublas-cu12==12.1.3.1
nvidia-cuda-cupti-cu12==12.1.105
nvidia-cuda-nvrtc-cu12==12.1.105
nvidia-cuda-runtime-cu12==12.1.105
nvidia-cudnn-cu12==8.9.2.26
nvidia-cufft-cu12==11.0.2.54
nvidia-curand-cu12==10.3.2.106
nvidia-cusolver-cu12==11.4.5.107
nvidia-cusparse-cu12==12.1.0.106
nvidia-nccl-cu12==2.19.3
nvidia-nvjitlink-cu12==12.3.101
nvidia-nvtx-cu12==12.1.105
onnxruntime==1.16.1
opencv-python==4.9.0.80
orjson==3.9.13
outcome==1.3.0.post0
packaging==23.2
pandas==2.2.0
parsel==1.8.1
pexpect==4.9.0
pillow==10.2.0
pkginfo==1.9.6
platformdirs==3.11.0
playwright==1.40.0
poetry==1.7.1
poetry-core==1.8.1
poetry-plugin-export==1.6.0
Protego==0.3.0
protobuf==4.25.2
proxybroker @ git+https://github.com/bluet/proxybroker2.git@dc944d6047beb73c281b0f9df238ac5ee1130ac7
psutil==5.9.8
psycopg2-binary==2.9.9
ptyprocess==0.7.0
py-cpuinfo==9.0.0
pyasn1==0.5.1
pyasn1-modules==0.3.0
pybrowsers==0.5.2
pycares==4.4.0
pycparser==2.21
pydantic==2.6.1
pydantic_core==2.16.2
PyDispatcher==2.0.7
pyee==11.0.1
pyOpenSSL==24.0.0
pyparsing==3.1.1
pyproject_hooks==1.0.0
PySocks==1.7.1
python-dateutil==2.8.2
python-dotenv==1.0.1
pytz==2024.1
PyWavelets==1.5.0
pyxdg==0.28
PyYAML==6.0.1
queuelib==1.6.2
rapidfuzz==3.6.1
recognizer==1.1
regex==2023.12.25
requests==2.31.0
requests-file==2.0.0
requests-toolbelt==1.0.0
safetensors==0.4.2
scikit-image==0.21.0
scikit-learn==1.4.0
scipy==1.12.0
Scrapy==2.11.0
scrapy-rotating-proxies==0.6.2
seaborn==0.13.2
SecretStorage==3.3.3
selenium==4.17.2
service-identity==24.1.0
shellingham==1.5.4
six==1.16.0
sniffio==1.3.0
sortedcontainers==2.4.0
SQLAlchemy==2.0.25
structlog==24.1.0
sympy==1.12
tenacity==8.2.3
thop==0.1.1.post2209072238
threadpoolctl==3.2.0
tifffile==2024.1.30
tldextract==5.1.1
tokenizers==0.15.1
tomli==2.0.1
tomlkit==0.12.3
torch==2.2.0
torchvision==0.17.0
tqdm==4.66.1
transformers==4.37.2
trio==0.24.0
trio-websocket==0.11.1
triton==2.2.0
trove-classifiers==2024.1.31
Twisted==22.10.0
typing==3.7.4.3
typing_extensions==4.9.0
tzdata==2023.4
ultralytics==8.1.10
undetected-chromedriver @ git+https://www.github.com/ultrafunkamsterdam/undetected-chromedriver@783b8393157b578e19e85b04d300fe06efeef653
undetected-playwright-patch==1.40.0.post1700587210000
urllib3==2.2.0
virtualenv==20.25.0
w3lib==2.1.2
wcwidth==0.2.13
websockets==12.0
wsproto==1.2.0
yarl==1.9.4
zipp==3.17.0
zope.interface==6.1

How to apply to your BotRight?

How should I apply it to playwright or your Botright? Currently, your Botright can pass Akamai, but Kasada cannot. I am thinking how to apply the fingerprints you collected directly to your Botright or Playwright.
In addition, I found DrissionPage, an open source automation library that can 100% pass CloudFlare, but it cannot achieve random fingerprints. https://g1879.gitee.io/drissionpagedocs/

Finally, I want to ask, how can I pass Kasada?For example, this website:

https://www.aircanada.com/aeroplan/redeem/availability/outbound?org0=JFK&dest0=LHR&departureDate0=2024-01-01&lang=en-CA&tripType=O&ADT=1&YTH=0&CHD=0&INF=0&INS=0&marketCode= INT

has both Akamai and Kasada encryption. It can currently pass Akamai 100%, but Kasada cannot. With frequent requests, it will block the environment. How to solve it?

[Question] Icon Captcha solving

Hi there :)

I can't find any documentation and function related to Icon Captcha (v3 or v4) solving, is it not available yet or I am not searching the right place ? (captcha solving documentations looks down anyways, but few tests scripts are available on the repo, but not for icon captcha)

[BUG] HCaptcha on discord not loaded

image
Tried changing ip but not worked. But hcaptcha loads on other browsers( chrome, edge, brave.. etc) loaded captcha successfully

async def main():
    botright_client = await botright.Botright()
    browser = await botright_client.new_browser()
    page = await browser.new_page()
    await page.goto("https://discord.com") # load|domcontentloaded|networkidle|commit

[BUG] opencv hcaptcha-challenger

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/tmp/worker/wk-macmini-1-92af8d859120-xmlAq/018e98a5-3e01-8b7b-c8e2-0f6a24718179/wrapper.py", line 9, in <module>
    from u.user import snazzy_script as inner_script
  File "/tmp/worker/wk-macmini-1-92af8d859120-xmlAq/018e98a5-3e01-8b7b-c8e2-0f6a24718179/u/user/snazzy_script.py", line 2, in <module>
    import botright
  File "/tmp/worker/cache/pip/botright==0.5.1/botright/__init__.py", line 1, in <module>
    from .botright import Botright
  File "/tmp/worker/cache/pip/botright==0.5.1/botright/botright.py", line 10, in <module>
    import hcaptcha_challenger as solver
  File "/tmp/worker/cache/pip/hcaptcha-challenger==0.10.1.post2/hcaptcha_challenger/__init__.py", line 13, in <module>
    from hcaptcha_challenger.components.image_classifier import Classifier as BinaryClassifier
  File "/tmp/worker/cache/pip/hcaptcha-challenger==0.10.1.post2/hcaptcha_challenger/components/image_classifier.py", line 12, in <module>
    import cv2
  File "/tmp/worker/cache/pip/opencv-python==4.9.0.80/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/tmp/worker/cache/pip/opencv-python==4.9.0.80/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

I tried to install opencv-python-headless but it doesn't work on my docker-linux environment.

Which versions should be used for fix?

Related QIN2DIM/hcaptcha-challenger#593

Add `py.typed` file for type hints

This project is beautifully (and fully) type-hinted, which is sort of wasted since neither mypy nor pyright will recognize them without a py.typed file at the package root. It can be just an empty, touch file.

How can I add args?

Newbie question guys, but how can I add args to Botright?

context_args = {
    'viewport': {'width': 1920, 'height': 1080},
}

options = {
    'args': [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-dev-shm-usage',
        '--disable-accelerated-2d-canvas',
        '--no-first-run',
        '--no-zygote',
        # '--single-process',
        '--disable-gpu'
    ],
    'headless': False
}

botright_client = await botright.Botright(**options, cache_responses=True)
browser = await botright_client.new_browser(**context_args)
page = await browser.new_page()

I have this slice of code and context args works fine but idk where to place my browser args (in original playwrite it works).

installing issue

Hello when i try installing i get this issue and i restarded pc but still

[Question]

Is there an easy way to specify a randomized mobile user-agent on browser init?

[BUG] Infinite script loop πŸ€·πŸ»β€β™‚οΈ

Describe the bug
Infinite loop on script using botright.
The browser (chrome / chromium...) starts by itself, automated by the script i've made (demo example, nothing particular).
But the script keeps running, even if i stop my script. It just keeps launching the browser and process the script.

Code Sample

import asyncio

import botright


async def main():
    botright_client = await botright.Botright()
    browser = await botright_client.new_browser()
    page = await browser.new_page()

    # Continue by using the Page
    await page.goto("https://google.com")

    await botright_client.close()


if __name__ == "__main__":
    asyncio.run(main())

To Reproduce
I don't know, just got a venv, and running with python main.py

Expected behavior
Expect the script to just run once, not forever.

Desktop (please complete the following information):

  • OS: MacOS Sonoma (Apple M2)
  • Version 14.3.1 (23D60)
  • Python 3.11.5
  • pip 24.0 from venv/lib/python3.11/site-packages/pip (python 3.11)

Auto install Playwright driver

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
It would be nice if Botright auto installed the playwright driver like this:

from setuptools import setup 
from sys import executable as python
from distutils.command.sdist import sdist
from distutils.errors import DistutilsExecError

class install_playwright_driver(sdist):
    def run(self):
        try:
            self.spawn([python, "-m", "playwright", "install", "firefox"])

        except DistutilsExecError:
            self.warn("There was an error installing the Playwright driver!")

        super().run()


setup(cmdclass={"sdist": install_playwright_driver})

Could you put delete_botright_temp_dirs method into try_catch statements?

Hi, I think your Botright is awesome.
But it could be more awesome if you could put
self.delete_botright_temp_dirs()
into try except statements. Because I used to open like 10 multiple Botright at the same time. And the first 10 opens well but
when they are restarting, this part is making an exception. Could you please fix this?

async def ainit(
self,
headless: Optional[bool] = False,
block_images: Optional[bool] = False,
cache_responses: Optional[bool] = False,
user_action_layer: Optional[bool] = False,
scroll_into_view: Optional[bool] = True,
spoof_canvas: Optional[bool] = True,
mask_fingerprint: Optional[bool] = True,
use_undetected_playwright: Optional[bool] = False,
) -> None:
"""
Initialize a Botright instance with specified configurations.

    Args:
        headless (bool, optional): Whether to run the browser in headless mode. Defaults to False.
        block_images (bool, optional): Whether to block images in the browser. Defaults to False.
        cache_responses (bool, optional): Whether to cache HTTP responses. Defaults to False.
        user_action_layer (bool, optional): Whether to enable user action simulation layer. Defaults to False.
        scroll_into_view (bool, optional): Whether to scroll elements into view automatically. Defaults to True.
        spoof_canvas (bool, optional): Whether to disable canvas fingerprinting protection. Defaults to True.
        mask_fingerprint (bool, optional): Whether to mask the browser fingerprint. Defaults to True.
        use_undetected_playwright (bool, optional): Whether to use undetected_playwright . EXPERIMENTAL (TEMP). Defaults to False.
    """

    # Init local-side of the ModelHub
    solver.install(upgrade=True)
    # Starting Playwright
    if use_undetected_playwright:
        # (TODO: TEMP)
        self.playwright: Playwright = await undetected_async_playwright().start()  # type: ignore
    else:
        self.playwright = await async_playwright().start()

    # Getting Chromium based browser engine and deleting botright temp dirs
    self.browser = self.get_browser_engine()
    try:
        self.delete_botright_temp_dirs()
    except Exception as e:
        print(e)
    # Setting Values
    self.headless = headless
    self.block_images = block_images
    self.cache_responses = cache_responses
    self.scroll_into_view = scroll_into_view
    self.user_action_layer = user_action_layer
    self.mask_fingerprint = mask_fingerprint
    self.use_undetected_playwright = use_undetected_playwright
    self.cache: Dict[str, APIResponse] = {}

    # '--disable-gpu', '--incognito', '--disable-blink-features=AutomationControlled'
    # fmt: off
    self.flags = ['--incognito', '--accept-lang=en-US', '--lang=en-US', '--no-pings', '--mute-audio', '--no-first-run', '--no-default-browser-check', '--disable-cloud-import',
                  '--disable-gesture-typing', '--disable-offer-store-unmasked-wallet-cards', '--disable-offer-upload-credit-cards', '--disable-print-preview', '--disable-voice-input',
                  '--disable-wake-on-wifi', '--disable-cookie-encryption', '--ignore-gpu-blocklist', '--enable-async-dns', '--enable-simple-cache-backend', '--enable-tcp-fast-open',
                  '--prerender-from-omnibox=disabled', '--enable-web-bluetooth', '--disable-features=AudioServiceOutOfProcess,IsolateOrigins,site-per-process,TranslateUI,BlinkGenPropertyTrees',
                  '--aggressive-cache-discard', '--disable-extensions', '--disable-ipc-flooding-protection', '--disable-blink-features=AutomationControlled', '--test-type',
                  '--enable-features=NetworkService,NetworkServiceInProcess,TrustTokens,TrustTokensAlwaysAllowIssuance', '--disable-component-extensions-with-background-pages',
                  '--disable-default-apps', '--disable-breakpad', '--disable-component-update', '--disable-domain-reliability', '--disable-sync', '--disable-client-side-phishing-detection',
                  '--disable-hang-monitor', '--disable-popup-blocking', '--disable-prompt-on-repost', '--metrics-recording-only', '--safebrowsing-disable-auto-update', '--password-store=basic',
                  '--autoplay-policy=no-user-gesture-required', '--use-mock-keychain', '--force-webrtc-ip-handling-policy=disable_non_proxied_udp',
                  '--webrtc-ip-handling-policy=disable_non_proxied_udp', '--disable-session-crashed-bubble', '--disable-crash-reporter', '--disable-dev-shm-usage', '--force-color-profile=srgb',
                  '--disable-translate', '--disable-background-networking', '--disable-background-timer-throttling', '--disable-backgrounding-occluded-windows', '--disable-infobars',
                  '--hide-scrollbars', '--disable-renderer-backgrounding', '--font-render-hinting=none', '--disable-logging', '--enable-surface-synchronization',
                  '--run-all-compositor-stages-before-draw', '--disable-threaded-animation', '--disable-threaded-scrolling', '--disable-checker-imaging',
                  '--disable-new-content-rendering-timeout', '--disable-image-animation-resync', '--disable-partial-raster', '--blink-settings=primaryHoverType=2,availableHoverTypes=2,'
                  'primaryPointerType=4,availablePointerTypes=4', '--disable-layer-tree-host-memory-pressure']

[Question] Botright throws an error in my VM

Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\idlelib\run.py", line 578, in runcode
exec(code, self.locals)
File "C:\Users\Administrator\Desktop-_\index.py", line 2, in
import botright
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botright_init_.py", line 3, in
from .botright import *
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\botright.py", line 6, in
from .modules.playwright_mock import browser
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\playwright_mock_init_.py", line 7, in
from .page import new_page
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\playwright_mock\page.py", line 7, in
from .. import hcaptcha
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\hcaptcha.py", line 8, in
from .hcaptcha_challenger import (DIR_CHALLENGE, DIR_MODEL, PATH_OBJECTS_YAML, ArmorCaptcha)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\hcaptcha_challenger_init_.py", line 6, in
from .core import ArmorCaptcha
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\hcaptcha_challenger\core.py", line 4, in
from .solutions import resnet, sk_recognition, yolo
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\hcaptcha_challenger\solutions\sk_recognition.py", line 11, in
from skimage import feature
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\skimage_shared\lazy.py", line 62, in getattr
return importlib.import_module(f'{package_name}.{name}')
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\importlib_init_.py", line 126, in import_module
return _bootstrap.gcd_import(name[level:], package, level)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\skimage\feature_init
.py", line 4, in
from ._cascade import Cascade
ImportError: DLL load failed while importing _cascade: μ§€μ •λœ λͺ¨λ“ˆμ„ 찾을 수 μ—†μŠ΅λ‹ˆλ‹€.

[BUG] RuntimeError: PyTourchStreamReader failed reading zip archive: failed finding central directory

Describe the bug
I tried to install Botright on a Linux Ubuntu Server but due to some smaller issues (like installing tensorflow on a server without gpu and cpu only) i needed to manually download Botright and change the tensorflow requirement in setup.py to tensorflow-cpu. After Botright were installed sucessfully on the Linux System i ran my script which then produced the Error mentioned in the Title.

To Reproduce
Steps to reproduce the behavior:

  1. Use a ubuntu Linux Machine (I used Linode)
  2. Got Clone this repo, cd into the cloned repo
  3. Change the requirement list in setup.py to tensorflow-cpu instead of tensorflow
  4. Install it using pip install -e .

Expected behavior
It should download the AI Files, open Browser, solve captcha.

Screenshots
grafik

Desktop (Bash only - No Desktop present):

  • OS: Ubuntu
  • Version: 22.04 LTS

Error with PIP package

ERROR: Cannot install botright because these package versions have conflicting dependencies.

The conflict is caused by:
hcaptcha-challenger 0.10.1.post2 depends on onnxruntime==1.16.1
hcaptcha-challenger 0.10.1.post1 depends on onnxruntime==1.16.1

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

[BUG] Can't import Botright

Describe the bug
Hi, I can't import Botright.

Code Sample

Traceback (most recent call last):
  File "g:\Projets\XXXXXXXXXXXXXXX\main.py", line 9, in <module>
    import botright
  File "C:\Users\imprv\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\__init__.py", line 1, in <module>
    from .botright import *
  File "C:\Users\imprv\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\botright.py", line 6, in <module>
    from .modules.playwright_mock import browser
  File "C:\Users\imprv\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\playwright_mock\__init__.py", line 7, in <module>
    from .page import new_page
  File "C:\Users\imprv\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\playwright_mock\page.py", line 6, in <module>
    from .. import geetest, hcaptcha, recaptcha
  File "C:\Users\imprv\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\hcaptcha.py", line 16, in <module>
    class hCaptcha:
  File "C:\Users\imprv\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\hcaptcha.py", line 18, in hCaptcha
    solver.install()
AttributeError: module 'hcaptcha_challenger' has no attribute 'install

To Reproduce
Steps to reproduce the behavior:

  1. Import botright

Desktop (please complete the following information):

  • OS: Windows
  • Version: 10

[BUG] Big bug with your new update

Hi, "ModuleNotFoundError: No module named 'browsers'" i checked everything, no module of this name is installable and you have not mentioned it anywhere.

How to use the --incognito flag with Botright?

Describe your quesiton
I would like to know how to use the --incognito flag with Botright.

Expected behavior
I expect to be able to launch a browser instance with the --incognito flag enabled using Botright.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04
  • Python version: 3.10
  • Botright version: 0.5.1

Additional context
I've tried passing the --incognito flag as an argument when creating a new Browser instance, but it doesn't seem to work. Is there a specific way to enable incognito mode with Botright? Any guidance on this issue would be greatly appreciated. Thank you!

[BUG] socks5 proxy

Describe the bug

  File "/Users/wenke/miniconda3/lib/python3.9/site-packages/tsup-0.1.16-py3.9.egg/tsup/botright/botright.py", line 26, in new_browser
    _proxy = await ProxyManager(self, proxy)
  File "/Users/wenke/miniconda3/lib/python3.9/site-packages/async_class.py", line 173, in __await__
    yield from self.create_task(
  File "/Users/wenke/miniconda3/lib/python3.9/site-packages/tsup-0.1.16-py3.9.egg/tsup/botright/modules/proxy_manager.py", line 28, in __ainit__
    self.split_proxy()
  File "/Users/wenke/miniconda3/lib/python3.9/site-packages/tsup-0.1.16-py3.9.egg/tsup/botright/modules/proxy_manager.py", line 68, in split_proxy
    raise SplitError(f"Proxy Format ({self.proxy}) isnt supported")
tsup.botright.modules.proxy_manager.SplitError: Proxy Format (socks5://127.0.0.1:1080) isnt supported

Code Sample
If applicable, add a code sample to replicate the bug.

To Reproduce

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Please dockerize this project and create extension/addon and automate this process in easy comfortable way

hi dev, can you create extension or addon of this which is capable of fetching the audio from page and process it and then write back the text in the desired area automatically of recaptcha.maybe you can create docker app/server which we can selfhost and run in our system which can take the audio url from current page with extension using javascript dom and feed it to docker server running your python program and it process and give back the text (result) back to extension after processing and auto write in recaptcha audio box so in that way atleast this process with be automatic and will help in solving atleast audio ones easily. I know google have implemented safety system for audio verification because of which we cant solve it many times, but tbh in day i and hoepfully others dont need to solve that many and it should work for normal usecase and if person face issue then he/she can create free 3-4 different country free accounts from vpn jantits weekly and use them in nekoray and clear cookies if facing any futher issues with audio i have done this experiment and it works fine too, So hopefully with any javascript dev or with help of gpt ai or gemini ai you will be able to implement this to automate things and make things fast and way to use. Hope to see its development.
Thankyou :-))

[BUG] FileNotFoundError: [Errno 2] No such file or directory: '/home/ubuntu/.local/lib/python3.10/site-packages/botright/fingerprint_generator\\fingerprints.json'

Describe the bug
FileNotFoundError: [Errno 2] No such file or directory: '/home/ubuntu/.local/lib/python3.10/site-packages/botright/fingerprint_generator\fingerprints.json'
Code Sample

import asyncio

import botright


async def main():
    botright_client = await botright.Botright()
    browser = await botright_client.new_browser()
    page = await browser.new_page()

    # Continue by using the Page
    await page.goto("https://google.com")

    await botright_client.close()

if __name__ == "__main__":
    asyncio.run(main()) 

To Reproduce
Steps to reproduce the behavior:

Installing models/objects.yaml: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3.00k/3.00k [00:00<00:00, 7.69MB/s]
[WARNING] Ungoogled Chromium not found. Recommended for stealthier botright and Canvas Manipulation. Download at https://ungoogled-software.github.io/ungoogled-chromium-binaries/ 
Traceback (most recent call last):
  File "/home/ubuntu/Desktop/workspace/Discord/v3 (copy)/test/a.py", line 17, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/ubuntu/Desktop/workspace/Discord/v3 (copy)/test/a.py", line 7, in main
    botright_client = await botright.Botright()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/async_class.py", line 173, in __await__
    yield from self.create_task(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/botright/botright.py", line 69, in __ainit__
    self.fingerprint_generator = FingerprintGenerator(os_dict[platform.system()])
  File "/home/ubuntu/.local/lib/python3.10/site-packages/botright/fingerprint_generator/fingerprint.py", line 20, in __init__
    self.bayesian_network = BayesianNetwork(path=rf"{os.path.dirname(os.path.abspath(__file__))}\fingerprints.json")
  File "/home/ubuntu/.local/lib/python3.10/site-packages/botright/fingerprint_generator/bayesian_network.py", line 109, in __init__
    with open(path, 'r', encoding='utf-8') as file:
FileNotFoundError: [Errno 2] No such file or directory: '/home/ubuntu/.local/lib/python3.10/site-packages/botright/fingerprint_generator\\fingerprints.json'

Expected behavior
just did pip install botright, playwright install and running the script and getting this error

Screenshots

Desktop (please complete the following information):

  • OS: ubuntu
  • Version 22.04.3 LTS x86_64

Additional context
Did pip install botright, playwright install again and still getting same error

Error installing botright due to scikit_image-0.21.0.tar.gz metadata preparation

I am facing an issue while trying to install the botright Python module, which requires the installation of various dependencies. During the installation process, it encounters an error specifically related to the preparation of metadata for scikit_image-0.21.0.tar.gz.

Error Message:
Error.txt

Expected Behavior:
I expected the installation of botright to proceed smoothly without encountering errors related to the preparation of metadata for scikit_image-0.21.0.tar.gz.

Environment:
Python Version: 3.12.0
Pip Version: 23.3.2
Additional Information:

I can successfully install the latest version of scikit_image without any issues.
Provide any other relevant information that might help identify and resolve the issue.

Thank you for your assistance in resolving this issue.

[BUG] Ungoogled Chromium not found

Thanks a lot for the work of this repo, it's a goldmine πŸš€

Describe the bug
I followed the installation guide but I still have this error:
[WARNING] Ungoogled Chromium not found. Recommended for Canvas Manipulation. Download at https://ungoogled-software.github.io/ungoogled-chromium-binaries/

But ungoogled chromium is installed:
type ungoogled-chromium
ungoogled-chromium is /usr/bin/ungoogled-chromium

Code Sample
If applicable, add a code sample to replicate the bug.

test code:

import asyncio
import botright

async def main():
    botright_client = await botright.Botright()
    # Add the path to your Chromium-based browser here
    browser = await botright_client.new_browser()
    page = await browser.new_page()

    await page.goto("https://google.com")

    await botright_client.close()

if __name__ == "__main__":
    asyncio.run(main())

To Reproduce
Steps to reproduce the behavior:

  1. Install Botright
  2. Install Playwright
  3. Install UC chromium
  4. See error

Expected behavior

Installing models/objects.yaml: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3.81k/3.81k [00:00<00:00, 3.71MB/s]
[WARNING] Ungoogled Chromium not found. Recommended for Canvas Manipulation. Download at https://ungoogled-software.github.io/ungoogled-chromium-binaries/ 
Traceback (most recent call last):
  File "/root/test.py", line 17, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/root/test.py", line 5, in main
    botright_client = await botright.Botright()
  File "/usr/local/lib/python3.10/dist-packages/async_class.py", line 173, in __await__
    yield from self.create_task(
  File "/usr/local/lib/python3.10/dist-packages/botright/botright.py", line 90, in __ainit__
    self.browser = self.get_browser_engine()
  File "/usr/local/lib/python3.10/dist-packages/botright/botright.py", line 216, in get_browser_engine
    raise EnvironmentError("No Chromium based browser found")
OSError: No Chromium based browser found

Desktop (please complete the following information):

  • OS: Ubuntu 22.04

[BUG] IndexError: list index out of range on captcha solving

Describe the bug
hcaptcha solving raise a keyerror
issue is being raised in botright\modules\hcaptcha.py on line 102
i haven't changed any code in the botright folder but changed a few things in the discordgenerator file (not changed anything which has to do with captcha solving tho)

Code Sample

 Error:
 Traceback (most recent call last):
  File "D:\toolcollection\DISLOCK V2\main.py", line 109, in generate_unclaimed
    await self.page.solve_hcaptcha()
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\playwright_mock\page.py", line 334, in solve_mocker
    return await hcaptcha.hCaptcha.solve_hcaptcha(page, rqdata=rqdata)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\hcaptcha.py", line 189, in solve_hcaptcha
    return await hCaptcha.solve_captcha(page, checkbox)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\botright\modules\hcaptcha.py", line 102, in solve_captcha
    image_url = style.split('url("')[1].split('"')[0]
IndexError: list index out of range

To Reproduce
Steps to reproduce the behavior:
The Error happen kinda random, i went to the hcaptcha file in botright/modules/hcaptcha.py and printed the style variable to see what the content is and got some news regarding the issue:

content of the variable if the captcha got solved with success:

position: absolute; top: 50%; left: 50%; z-index: 5; width: 120px; height: 120px; margin-left: -60px; margin-top: -60px; background: rgba(0, 0, 0, 0) url("https://imgs.hcaptcha.com/IsTLrDDDmlEbx5yG4yXLDBkNnSTQYHZadHCvLN69NQrryCA1NFLbzKr+tckmEbCzEap629sjf6dLltB9hTcRrHd+9MuNl3HaxG4OZkA4y1FchsXaiVNPyb+BwdfGewU8j3I9ofj19Aun2AvvY96bO/EZ6mC05aYPhqiVTkq7GXg/TyS9ll6/vH9HRyOQyfu6/s2S") no-repeat scroll 50% 50% / 120px 120px;
position: absolute; top: 50%; left: 50%; z-index: 5; width: 120px; height: 120px; margin-left: -60px; margin-top: -60px; background: rgba(0, 0, 0, 0) url("https://imgs.hcaptcha.com/DxbqxuaJznkNc4cZYuy2L+f2I5MToE16OxLivxAqLZi00p8H2ZWvdTBzO+m5MAUREmqo4q0yf6caWXm1PhUXR4QBH+V+tZfcM1tj2Sn7HIwbLy/S49bE3Mq9t9TmslmkRyoAFRJgV0ynuK6aojxgT68XnAC8p7/bQL+B+TBLZQ==qKKnj8hbv+rLJJfn") no-repeat scroll 50% 50% / 120px 120px;
position: absolute; top: 50%; left: 50%; z-index: 5; width: 120px; height: 120px; margin-left: -60px; margin-top: -60px; background: rgba(0, 0, 0, 0) url("https://imgs.hcaptcha.com/znYzQ6QPofmqCXUX/EGbiJwiVNEwXqy8WOtOmJc8rtcMeKYaHNytDeQ75usnGCwW8EzVRxPdoECctQzAdM6RNd9T12uQZRBhw1yT/cksWOy1benvCxwGdatkYcF2e3HTATASHeBKMy2B1tvl3T6d7wZwg2iv8AwSI/DvzrI1fw==2QgccADdy+u7huGU") no-repeat scroll 50% 50% / 120px 120px;
position: absolute; top: 50%; left: 50%; z-index: 5; width: 120px; height: 120px; margin-left: -60px; margin-top: -60px; background: rgba(0, 0, 0, 0) url("https://imgs.hcaptcha.com/eEW1fL9QuB7rjmYD1hoToHqVFsoz4ejs1hfLvTByx/8OgGYs1+1QuNp18Mqylon6E2dnHQF3MSgNm73a2XwJ4NFDn1UUUy8oGtCCpE32vMjHwW5KuMJN6SJ1yk+5f8IHGnw4X0CKaE3uzY0b9cHEFRbQt3TB9b76G6CA2DbAhw==aR7VTJCSobgNC4Sf") no-repeat scroll 50% 50% / 120px 120px;
position: absolute; top: 50%; left: 50%; z-index: 5; width: 120px; height: 120px; margin-left: -60px; margin-top: -60px; background: rgba(0, 0, 0, 0) url("https://imgs.hcaptcha.com/NDTe0O4P8SezS6W89fY5l16jHnORW8krpT23x5MuWo1p+seebd2Ry9WFNnspY5rsM8LipA/AN3k+/Xel7KRaB97AuBwTT9LR0xkWHVHBbfYfYYJSB2ULSwQHz972AaDdlVI0YlKPggkRryut0eHsJ0oc8JbNLOTgNLkXl+0Pvp7sVVlWGg==MFJEV3Si/YcUWcqR") no-repeat scroll 50% 50% / 120px 120px;
position: absolute; top: 50%; left: 50%; z-index: 5; width: 120px; height: 120px; margin-left: -60px; margin-top: -60px; background: rgba(0, 0, 0, 0) url("https://imgs.hcaptcha.com/p9gvNAaEyt48qSISLY+mIJ3UAVz8a1XhKDwUtQhBSo+H7yBKNSf1tRGyiZyB4PCBUBtwT0wXIFij3R0dp5oDvIYml0HL/JLuMI8rY3YKevyl5JiwqgsBwuys5nJLGUCOa/Rg9f+1E+OON1MGmV//QI2+o9lbCCf29ujsmukzhiLeVdulPo0=DuM9Aei7uEDwUWMK") no-repeat scroll 50% 50% / 120px 120px;
position: absolute; top: 50%; left: 50%; z-index: 5; width: 120px; height: 120px; margin-left: -60px; margin-top: -60px; background: rgba(0, 0, 0, 0) url("https://imgs.hcaptcha.com/Tm/x3orx3hZtTGr5EILHk3kVUGWkpLsAMKvMiZ7vljzRu6LSYYfdMqMH63kMq66XDaZDRLgbJsvWvnSsWEU2XjYbu8SzlBI8ny7OpHy+kU8pFNiyI3biZaE8tO2eJbBxeZGQk3GyLNc6SWPjZ+f5biLbG/2yfNFAm7xJ904WwFEagS7VE5MVPzjB") no-repeat scroll 50% 50% / 120px 120px;
position: absolute; top: 50%; left: 50%; z-index: 5; width: 120px; height: 120px; margin-left: -60px; margin-top: -60px; background: rgba(0, 0, 0, 0) url("https://imgs.hcaptcha.com/g/WFsO6CwipkByvFFmRt/WRiwTi+SNBj75+1fibGTlFs4V+J+y0QnpFvFM06HSeJfjmSkSpVXb8qb4ZGLS8nUbvQUuzzj128LHHuJSXlF/xnpcryfJi6RTya+9pAY+UiXDHbIJ68oGa/nWL7BK/nYLg1zwVOve0bH/53uiHsgENgDZP2jj4=C88E7AMPrANFdgkG") no-repeat scroll 50% 50% / 120px 120px;
position: absolute; top: 50%; left: 50%; z-index: 5; width: 120px; height: 120px; margin-left: -60px; margin-top: -60px; background: rgba(0, 0, 0, 0) url("https://imgs.hcaptcha.com/pl+z6RhwLbdl+fqzfkCHsMHhF5M4Ix4v7ur9Gu6QIvJzpcL8DVmTSGrou//0Fx5owKJ7DX2zqdXRd/kpF457X8R/xg8ka79Z8vaLktw5WWjzEeHJv+qY5aUJm2K3DXcUtPwp+n5rH6/zA4ObbpMyu1jSzlfs2qalEowWXSJCwL8wUmU+kFBmeoSl") no-repeat scroll 50% 50% / 120px 120px;

if the captcha didn't got solved and the keyerror is being raised, the content of the style variable is following:

position: absolute; top: 0px; left: 0px; z-index: 5;

Expected behavior
Hmm, captcha solving should work as expected i guess

Screenshots
Not applicable, error mentioned above

Desktop (please complete the following information):

Additional context
404: No other context found.

[BUG] hcaptcha_challenger AttributeError

I get an AttributeError: module 'hcaptcha_challenger' has no attribute 'new_challenger' when importing the library, followed the install instructions.

Code Sample

import botright

Desktop (please complete the following information):

  • OS: Windows 10

[Question] Is there anyway to load cookies?

In Playwright you can load cookies like that:
context = await browser.new_context(storage_state=cookie_file)
Is it possible to do in Botright? I didn't find the solution :(

[BUG] KeyError: 'assets

Describe the bug
I assume that this happen because the hcaptcha-challanger github repo got termed so the script can't update itself with new captcha images, if there is a new challanger repo (not found one so far) or a up to date fork, you could replace the urls with that.

Code Sample

# main.py
import asyncio
import botright


async def main():
    botright_client = await botright.Botright()
    browser = await botright_client.new_browser()
    page = await browser.new_page()

    tkn = await browser.get_hcaptcha()
    print("tkn: ", tkn)
    page.goto("http://whatsmyuseragent.org/")
    page.screenshot(path="example.png")

    await botright_client.close()

if __name__ == "__main__":
    asyncio.run(main())
Traceback (most recent call last):
  File "/home/infinimonster/Documents/Privat/Python/discordphoneverify/new version/plugins/captcha/test.py", line 21, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/infinimonster/Documents/Privat/Python/discordphoneverify/new version/plugins/captcha/test.py", line 9, in main
    botright_client = await botright.Botright()
  File "/home/infinimonster/.local/lib/python3.10/site-packages/async_class.py", line 173, in __await__
    yield from self.create_task(
  File "/home/infinimonster/.local/lib/python3.10/site-packages/botright/botright.py", line 13, in __ainit__
    update_ai()
  File "/home/infinimonster/.local/lib/python3.10/site-packages/botright/modules/hcaptcha_challenger/update.py", line 17, in update_ai
    for asset in release["assets"]:
KeyError: 'assets

To Reproduce
Steps to reproduce the behavior:

  1. Copy the example code to add to a own script
  2. editing a few lines to solve captcha (which is not the issue, the issue lies in the browser initalization)
    3.Execute script and See error

Expected behavior
It should execute without any issue, start browser, solve captcha and return the captchatoken

Screenshots
I could show screenshots of the error but it's not needed as the error is above.

Desktop (please complete the following information):
2022-12-02_20-39

Additional context
404: Not found.

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.