auto-dolphin 0.0.12
Library for automating Dolphin{Anty} anti-detect browser's account creation and profile management
License: MIT
Requires Python: >=3.10

# Dolphin Manager

Looking to manage your Dolphin user accounts and profiles more efficiently? Look no further than Dolphin Manager! With the **'AccountManager'** class for MongoDB account management and the **'ProfileManager'** class for Dolphin profile manipulation, you'll have everything you need to streamline your workflow and boost your productivity. From creating and updating user accounts to deleting profiles and retrieving web service endpoints, Dolphin Manager has got you covered. Let's dive in and explore what these powerful tools can do for you.

## Prerequisites

Make sure you're using **Python 3.10.8** or higher. The script also requires a dolphin anti-detect browser manager to be installed.

## AccountManager

The **_'AccountManager'_** class manages user accounts stored in a MongoDB database. It takes three arguments in its constructor:

- **mongo_uri:** A string that specifies the URI of the MongoDB database.
- **document_id:** A string that specifies the ID of the document in the MongoDB collection that represents the user account being managed.
- **auto_update:** A boolean flag that determines whether the account details should be automatically updated if the free plan has expired.

The class has three methods for interacting with the MongoDB database:

- **fetch_account():** Retrieves the document from the MongoDB collection that corresponds to the user account being managed.
- **create_account():** Creates a new user account by generating a random username and password, and making a request to an external API to register the account. The generated username and password are stored in the MongoDB collection, along with an access token and an expiration date.
- **update_account():** Updates the user account by generating a new set of account details and making a request to the external API to update the account. The updated account details are stored in the MongoDB collection.

The **_'AccountManager'_** class uses the **_'pymongo'_** library to interact with the MongoDB database. It also uses the **_'requests'_** library to make HTTP requests to an external API to create and update user accounts. If any of the required arguments are missing in the constructor, a **_'ValueError'_** is raised. If there is no document in the MongoDB collection that corresponds to the specified **_'document_id'_**, a **_'Warning'_** is raised, and a new account is created if **_'auto_update'_** is **_'True'_**. If the account has expired, a **_'Warning'_** is raised, and the account is updated if **_'auto_update'_** is **_'True'_**.

## ProfileManager

The **_'ProfileManager'_** class contains methods for manipulating Dolphin profiles using the Dolphin-Anty API. The class constructor takes an authorization token as input, which is used when making API requests.

The class contains the following Dolphin profile manipulation methods:

- **list_profile_details()**: This method sends a GET request to the API endpoint to retrieve all profile details and returns them as a list of dictionaries.
- **list_profile_ids()**: This method retrieves all profile details using the list_profile_details() method and returns a list of profile IDs.
- **create_new_profile()**: This method creates a new Dolphin profile by sending a GET request to the API endpoint to retrieve a fingerprint, and then sending a POST request with the fingerprint payload to the API endpoint to create a new profile. The method returns the new profile as a dictionary.
- **delete_profile()**: This method deletes one or more profiles by sending a DELETE request to the API endpoint with the profile IDs to delete.
- **get_ws_endpoint_and_port()**: This method retrieves the web service endpoint and port for a specified profile by sending a GET request to the API endpoint. It simultaniously opens the browser with that profile.
- **close_browser()**: This method sends a GET request to the API endpoint to stop the specified browser profile.