vk-captcha


Namevk-captcha JSON
Version 2.0 PyPI version JSON
download
home_pagehttps://github.com/imartemy1524/vk_captcha
Summary
upload_time2023-03-26 14:47:26
maintainer
docs_urlNone
authorIMCorp
requires_python
licenseMIT
keywords vk vk_api captcha vk_captcha solver
VCS
bugtrack_url
requirements onnxruntime numpy opencv-python requests aiohttp
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">
<a href="https://github.com/imartemy1524/vk_captcha">vk_captcha</a> 
- AI <a href="https://vk.com/dev">VK</a> captcha solver for <b>93.2%</b> accuracy
</h1>

## Requirements
> Python3.3 - python3.10

~~Python 3.10 is not supported yet because 
[onnxruntime](https://pypi.org/project/onnxruntime/) 
is not supporting **python3.10**~~

#### UPDATE: Python3.10 is supported

## Installation


```
pip install vk_captcha
or
pip install https://github.com/imartemy1524/vk_captcha/raw/main/dist/vk_captcha-1.21.tar.gz
or
pip install git+https://github.com/imartemy1524/vk_captcha
```


### Fast examples:
Look into [VkHacker](VkHacker) for examples of accounts bruteforce

#### using [vk_api](https://github.com/python273/vk_api) library:

```python
from vk_captcha import vk_api_handler
vk = vk_api_handler.VkApiCaptcha("88005553535", "efwoewkofokw")  # this login will create captcha
vk_api_handler.Solver.logging = True  # enable logging
vk.auth() # get captcha error and automatically solve it
```

#### another way with [vk_api](https://github.com/python273/vk_api):

```python
from vk_captcha import VkCaptchaSolver
from vk_api import VkApi
solver = VkCaptchaSolver(logging=True)  # use logging=False on deploy
vk = VkApi(login='', password='', captcha_handler=solver.vk_api_captcha_handler)
vk.method("any.method.with.captcha.will.be.handled")
```

#### just solve captcha from *url* / *bytes*


```python
from vk_captcha import VkCaptchaSolver
import random, requests

session = requests.Session()  
session.headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0'

solver = VkCaptchaSolver(logging=True)  # use logging=False on deploy
sid = random.randint(122112, 10102012012012)
easy_captcha = False
url = f"https://api.vk.com/captcha.php?sid={sid}&s={int(easy_captcha)}"

answer, accuracy = solver.solve(
    url=url,
    minimum_accuracy=0.33,  # keep solving captcha while accuracy < 0.33
    repeat_count=14,  # if we solved captcha with less than minimum_accuracy, then retry repeat_count times
    session=session  # optional parameter. Useful if we want to use proxy or specific headers
)
# or
#answer, accuracy = solver.solve(bytes_data=session.get(url))
print(f"I solved captcha = {answer} with accuracy {accuracy:.4}")
```

#### async way:

```python
from vk_captcha import VkCaptchaSolver
import random, asyncio
solver = VkCaptchaSolver(logging=False)  # use logging=False on deploy
async def captcha_solver():
    sid = random.randint(122112, 10102012012012)
    easy_captcha = False
    url = f"https://api.vk.com/captcha.php?sid={sid}&s={int(easy_captcha)}"
    answer, accuracy = await solver.solve_async(url=url, minimum_accuracy=0.4, repeat_count=10)
    print(f"Solved captcha = {answer} with accuracy {accuracy:.4}")
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
asyncio.run(captcha_solver())
```
Also, you can get some statistics of solving captcha:
```python
from vk_captcha import VkCaptchaSolver
solver = VkCaptchaSolver()
...
# solve some captchas
...
time_for1captcha = solver.argv_solve_time
total_solved = solver.TOTAL_COUNT
fail_count = solver.FAIL_COUNT  # you need directly increase it after getting second captcha error
```

In theory, for other languages you can use command line solver ( **NOT RECOMMENDED**, it will always load model again):

```
python -m vk_captcha -url "https://api.vk.com/captcha.php?sid=2323832899382092" -minimum-accuracy 0.33 -repeat-count 13
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/imartemy1524/vk_captcha",
    "name": "vk-captcha",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "vk,vk_api,captcha,vk_captcha,solver",
    "author": "IMCorp",
    "author_email": "imartemy1@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b3/7d/3af4b15ccdc06af88c0616e6e6743de35ab6386f5ddf2064125eca75818f/vk_captcha-2.0.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">\n<a href=\"https://github.com/imartemy1524/vk_captcha\">vk_captcha</a> \n- AI <a href=\"https://vk.com/dev\">VK</a> captcha solver for <b>93.2%</b> accuracy\n</h1>\n\n## Requirements\n> Python3.3 - python3.10\n\n~~Python 3.10 is not supported yet because \n[onnxruntime](https://pypi.org/project/onnxruntime/) \nis not supporting **python3.10**~~\n\n#### UPDATE: Python3.10 is supported\n\n## Installation\n\n\n```\npip install vk_captcha\nor\npip install https://github.com/imartemy1524/vk_captcha/raw/main/dist/vk_captcha-1.21.tar.gz\nor\npip install git+https://github.com/imartemy1524/vk_captcha\n```\n\n\n### Fast examples:\nLook into [VkHacker](VkHacker) for examples of accounts bruteforce\n\n#### using [vk_api](https://github.com/python273/vk_api) library:\n\n```python\nfrom vk_captcha import vk_api_handler\nvk = vk_api_handler.VkApiCaptcha(\"88005553535\", \"efwoewkofokw\")  # this login will create captcha\nvk_api_handler.Solver.logging = True  # enable logging\nvk.auth() # get captcha error and automatically solve it\n```\n\n#### another way with [vk_api](https://github.com/python273/vk_api):\n\n```python\nfrom vk_captcha import VkCaptchaSolver\nfrom vk_api import VkApi\nsolver = VkCaptchaSolver(logging=True)  # use logging=False on deploy\nvk = VkApi(login='', password='', captcha_handler=solver.vk_api_captcha_handler)\nvk.method(\"any.method.with.captcha.will.be.handled\")\n```\n\n#### just solve captcha from *url* / *bytes*\n\n\n```python\nfrom vk_captcha import VkCaptchaSolver\nimport random, requests\n\nsession = requests.Session()  \nsession.headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0'\n\nsolver = VkCaptchaSolver(logging=True)  # use logging=False on deploy\nsid = random.randint(122112, 10102012012012)\neasy_captcha = False\nurl = f\"https://api.vk.com/captcha.php?sid={sid}&s={int(easy_captcha)}\"\n\nanswer, accuracy = solver.solve(\n    url=url,\n    minimum_accuracy=0.33,  # keep solving captcha while accuracy < 0.33\n    repeat_count=14,  # if we solved captcha with less than minimum_accuracy, then retry repeat_count times\n    session=session  # optional parameter. Useful if we want to use proxy or specific headers\n)\n# or\n#answer, accuracy = solver.solve(bytes_data=session.get(url))\nprint(f\"I solved captcha = {answer} with accuracy {accuracy:.4}\")\n```\n\n#### async way:\n\n```python\nfrom vk_captcha import VkCaptchaSolver\nimport random, asyncio\nsolver = VkCaptchaSolver(logging=False)  # use logging=False on deploy\nasync def captcha_solver():\n    sid = random.randint(122112, 10102012012012)\n    easy_captcha = False\n    url = f\"https://api.vk.com/captcha.php?sid={sid}&s={int(easy_captcha)}\"\n    answer, accuracy = await solver.solve_async(url=url, minimum_accuracy=0.4, repeat_count=10)\n    print(f\"Solved captcha = {answer} with accuracy {accuracy:.4}\")\nasyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())\nasyncio.run(captcha_solver())\n```\nAlso, you can get some statistics of solving captcha:\n```python\nfrom vk_captcha import VkCaptchaSolver\nsolver = VkCaptchaSolver()\n...\n# solve some captchas\n...\ntime_for1captcha = solver.argv_solve_time\ntotal_solved = solver.TOTAL_COUNT\nfail_count = solver.FAIL_COUNT  # you need directly increase it after getting second captcha error\n```\n\nIn theory, for other languages you can use command line solver ( **NOT RECOMMENDED**, it will always load model again):\n\n```\npython -m vk_captcha -url \"https://api.vk.com/captcha.php?sid=2323832899382092\" -minimum-accuracy 0.33 -repeat-count 13\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "",
    "version": "2.0",
    "split_keywords": [
        "vk",
        "vk_api",
        "captcha",
        "vk_captcha",
        "solver"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f420efa1857c4bb21791f5c351a27dcfe466900437cbc552d4c0e785e1127da1",
                "md5": "15ce553cee44b246eafce1d73ac08695",
                "sha256": "01ed144263980c2677b01729fbce6ea4e2a8e2950e449f13c4a6bbb8f225fb43"
            },
            "downloads": -1,
            "filename": "vk_captcha-2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "15ce553cee44b246eafce1d73ac08695",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 1625035,
            "upload_time": "2023-03-26T14:46:44",
            "upload_time_iso_8601": "2023-03-26T14:46:44.002338Z",
            "url": "https://files.pythonhosted.org/packages/f4/20/efa1857c4bb21791f5c351a27dcfe466900437cbc552d4c0e785e1127da1/vk_captcha-2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b37d3af4b15ccdc06af88c0616e6e6743de35ab6386f5ddf2064125eca75818f",
                "md5": "ea143099b1d0abf01b1c543225c96433",
                "sha256": "767f82168b637476614aa19ade055a552a4c7b0aa1f48409005041ae45cfd898"
            },
            "downloads": -1,
            "filename": "vk_captcha-2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ea143099b1d0abf01b1c543225c96433",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 1627662,
            "upload_time": "2023-03-26T14:47:26",
            "upload_time_iso_8601": "2023-03-26T14:47:26.223983Z",
            "url": "https://files.pythonhosted.org/packages/b3/7d/3af4b15ccdc06af88c0616e6e6743de35ab6386f5ddf2064125eca75818f/vk_captcha-2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-26 14:47:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "imartemy1524",
    "github_project": "vk_captcha",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "onnxruntime",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "opencv-python",
            "specs": []
        },
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "aiohttp",
            "specs": []
        }
    ],
    "lcname": "vk-captcha"
}
        
Elapsed time: 0.85774s