{"id":17651403,"url":"https://github.com/DedInc/pyanty","last_synced_at":"2025-03-10T21:31:05.597Z","repository":{"id":207868156,"uuid":"720309953","full_name":"DedInc/pyanty","owner":"DedInc","description":"Python module for controlling Dolphin browser profiles using Selenium, Pyppeteer, and Playwright. Includes Dolphin API for profile management.","archived":false,"fork":false,"pushed_at":"2024-06-08T08:27:56.000Z","size":42,"stargazers_count":56,"open_issues_count":1,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-06T01:24:11.099Z","etag":null,"topics":["automation","dolphin-antidetect","dolphin-anty","dolphin-browser","pyanty","pyppeteer","selenium","selenium-python","selenium-webdriver","web-automation"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pyanty","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DedInc.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-18T04:45:55.000Z","updated_at":"2025-02-06T13:44:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"82ab6afd-1ff8-4cf5-ad39-10c9a5dcf352","html_url":"https://github.com/DedInc/pyanty","commit_stats":null,"previous_names":["dedinc/selenium_dolphin"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DedInc%2Fpyanty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DedInc%2Fpyanty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DedInc%2Fpyanty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DedInc%2Fpyanty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DedInc","download_url":"https://codeload.github.com/DedInc/pyanty/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242930159,"owners_count":20208408,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","dolphin-antidetect","dolphin-anty","dolphin-browser","pyanty","pyppeteer","selenium","selenium-python","selenium-webdriver","web-automation"],"created_at":"2024-10-23T11:42:07.867Z","updated_at":"2025-03-10T21:31:05.243Z","avatar_url":"https://github.com/DedInc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🐬 pyanty\n\nPython module for controlling Dolphin browser profiles using Selenium, Pyppeteer, and Playwright. Includes Dolphin API for profile management.\n\n## ⚠️ Warning!\n\n```\nSelenium and some features working only if Dolphin Anty is opened!!! (Local API wrapper must be launched!)\n```\n\n## 🚀 Quickstart\n\n### Selenium\n\n```python\nimport random\nimport pyanty as dolphin\nfrom pyanty import DolphinAPI, STABLE_CHROME_VERSION\n\napi = DolphinAPI(api_key='Your Api Key')\n\nresponse = api.get_profiles()\nif response['data']:\n    profile_id = response['data'][-1]['id']\n    if profile_id:\n        api.delete_profiles([profile_id])\n\nfingerprint = []\nwhile not fingerprint:\n  fingerprint = api.generate_fingerprint(platform='windows', browser_version=f'{random.randint(114, STABLE_CHROME_VERSION)}')\n\ndata = api.fingerprint_to_profile(name='my superprofile', fingerprint=fingerprint)\n\nprofile_id = api.create_profile(data)['browserProfileId']\n\nresponse = dolphin.run_profile(profile_id)\nport = response['automation']['port']\n\ndriver = dolphin.get_driver(port=port)\ndriver.get('https://google.com/')\nprint(driver.title)\ndriver.quit()\n\ndolphin.close_profile(profile_id)\n```\n\n### Pyppeteer\n\n```python\nimport asyncio\nimport random\nimport pyanty as dolphin\nfrom pyanty import DolphinAPI, STABLE_CHROME_VERSION\n\napi = DolphinAPI(api_key='Your Api Key')\n\nresponse = api.get_profiles()\nif response['data']:\n    profile_id = response['data'][-1]['id']\n    if profile_id:\n        api.delete_profiles([profile_id])\n\nfingerprint = []\nwhile not fingerprint:\n  fingerprint = api.generate_fingerprint(platform='windows', browser_version=f'{random.randint(114, STABLE_CHROME_VERSION)}')\n\ndata = api.fingerprint_to_profile(name='my superprofile', fingerprint=fingerprint)\n\nprofile_id = api.create_profile(data)['browserProfileId']\n\nresponse = dolphin.run_profile(profile_id)\nport = response['automation']['port']\nws_endpoint = response['automation']['wsEndpoint']\n\nasync def main():\n    browser = await dolphin.get_browser(ws_endpoint, port)\n    pages = await browser.pages()\n    page = pages[0]\n    await page.goto('http://google.com/')\n    await asyncio.sleep(5)\n    await browser.disconnect()\n\nasyncio.run(main())\ndolphin.close_profile(profile_id)\n```\n\n### Playwright\n\n```python\nimport asyncio\nimport random\nimport pyanty as dolphin\nfrom pyanty import DolphinAPI, STABLE_CHROME_VERSION\n\napi = DolphinAPI(api_key='Your Api Key')\n\nresponse = api.get_profiles()\nif response['data']:\n    profile_id = response['data'][-1]['id']\n    if profile_id:\n        api.delete_profiles([profile_id])\n\nfingerprint = []\nwhile not fingerprint:\n  fingerprint = api.generate_fingerprint(platform='windows', browser_version=f'{random.randint(114, STABLE_CHROME_VERSION)}')\n\ndata = api.fingerprint_to_profile(name='my superprofile', fingerprint=fingerprint)\n\nprofile_id = api.create_profile(data)['browserProfileId']\n\nresponse = dolphin.run_profile(profile_id)\nport = response['automation']['port']\nws_endpoint = response['automation']['wsEndpoint']\n\nasync def main():\n    browser = await dolphin.get_browser(ws_endpoint, port, core='playwright')\n    pages = await browser.pages()\n    page = pages[0]\n    await page.goto('http://google.com/')\n    await asyncio.sleep(5)\n    await browser.disconnect()\n\nasyncio.run(main())\ndolphin.close_profile(profile_id)\n```\n\n## 📝 Get profiles\n\n```python\nfrom pyanty import DolphinAPI\n\napi = DolphinAPI() # you can enter api_key='Your key' inside instance\n```\n\nYou can [get an API key here](https://dolphin-anty.com/panel/#/api), but if the token is present in the logs, the module can automatically retrieve it.\n\n```python\nresponse = api.get_profiles() \n\nprint(response)\n```\n\n### Pagination and limitation\n\n```python\nresponse = api.get_profiles(page=1, limit=300) # default page - 1 limit - 50\n```\n\n## 🆕 Create profile\n\n```python\nfingerprint = api.generate_fingerprint(platform='linux') # you can use platform windows/linux/macos, also you can use screen='1366x768' and browser_version='116' if you need\n\ndata = api.fingerprint_to_profile(name='my profile', fingerprint=fingerprint) # also you can add tags=['test', 'pyanty'] and other\n\nresponse = api.create_profile(data)  \n\nprint(response)\n```\n\n## 📝 Custom data for profile\n\nAfter this line:\n\n```python\ndata = api.fingerprint_to_profile(name='my profile', fingerprint=fingerprint)\n```\n\nUse for:\n\n### Geolocation 🗺️\n\n```python\ndata.update({'geolocation':{\n  'mode': 'manual',\n  'latitude': 33.4,\n  'longitude': 55.2,\n  'accuracy': 318\n}})\n```\n\n### Timezone ⏰\n\n```python\ndata.update({'timezone':{\n  'mode':'manual',\n  'value':'Pacific/Johnston'\n}})\n```\n\n### Locale 🌎\n\n```python\ndata.update({'locale':{\n  'mode':'manual',\n  'value':'af_ZA' \n}})\n```\n\n### Proxy 🕸️\n\n```python\ndata.update({'proxy':{\n  'name': 'http://37.19.220.129:8443',\n  'host': '37.19.220.129',\n  'port': '8443',\n  'type': 'http' \n}})\n# also you can add 'login' and 'password' args\n```\n\n### and others...\n\n## ✏️ Edit profile\n\n```python \nfrom pyanty import DolphinAPI\n\napi = DolphinAPI()\n\nfingerprint = api.generate_fingerprint(platform='windows') \n\ndata = api.fingerprint_to_profile(name='mega profile', fingerprint=fingerprint)\n\nresponse = api.edit_profile(190438486, data)\n\nprint(response)\n```\n\n## 🗑️ Delete profile(s)\n\n```python\nfrom pyanty import DolphinAPI\n\napi = DolphinAPI()\n\nresponse = api.delete_profiles([190438486]) # you need specify list ids of profiles  \n\nprint(response)\n```\n\n## 🧩 Using Extensions\n\n### Get extensions\n\n```python\nresponse = api.get_extensions() \n\nprint(response)\n```\n\n### Pagination and limitation\n\n```python\nresponse = api.get_extensions(page=1, limit=300) # default page - 1 limit - 50\n```\n\n## 🏪 Load from Chrome Extensions Store\n\n```python\nresponse = api.load_extension_from_url('https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm')\n\nprint(response)\n```\n\n## 📦 Load from ZIP Archive\n\n```python\nresponse = api.load_extension_from_zip(extension_name='Test', path='path/to/archive.zip')\n\nprint(response)\n```\n\n## 🗑️ Delete extension(s)\n\n```python\nresponse = api.delete_extensions([63654]) # you need specify list ids of profiles  \n\nprint(response)\n```\n\n## 🔍 Other features\n\n### Proxy checker\n\n```python\nresponse = api.check_proxy(host='37.19.220.129', port='8443', type='http')\n\nprint(response)\n\n# also you can use other kwargs (login='username', password='password')\n```\n\nResponse:\n\n```json\n{\"success\": true, \"country\": \"US\", \"region\": \"Virginia\", \"city\": \"Ashburn\", \"ip\": \"37.19.220.178\", \"timezone\": \"America/New_York\"}\n```\n\n### MAC Address generator\n\n```python\nresponse = api.generate_mac()  \n\nprint(response) \n```\n\nResponse:\n\n```json\n{\"success\": true, \"macAddress\": \"8E:DD:48:08:F1:31\"}\n```\n\n## Conclusion\n\npyanty provides a straightforward way to control Dolphin browser profiles for automation testing using Selenium, Pyppeteer or Playwright 🤖. With the Dolphin API, you can easily create, customize, and manage profiles right from Python. Give it a try for your next web scraping or test automation project! 🐬\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDedInc%2Fpyanty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDedInc%2Fpyanty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDedInc%2Fpyanty/lists"}