Skip to content

Commit

Permalink
Merge remote-tracking branch 'github/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
diezo committed Mar 12, 2024
2 parents bd8fc8f + d6d3670 commit dd15a94
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 24 deletions.
11 changes: 11 additions & 0 deletions MOBILE_MIGRATION_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Checklist
Features yet to be migrated to [**Mobile.py**](https://github.com/diezo/ensta/tree/master/ensta/Mobile.py):

- **Fetch Posts (By *username*)**
- **Fetch Individual Post Data (By *share_url*)**

- **Upload Reel**
- **FB Video Uploader**
- **Configure Reel**

- **Fetch Likers**
53 changes: 39 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@ Download an Instagram [**Account Creator**](https://sonii.gumroad.com/l/account-
- Auto-updates Profile Picture to an **AI-Generated Human Face**.
- Sets a random **AI-Generated Biography** on account creation.
Creator should only be used for legitimate purposes. It's strictly not for spam.
Creator should only be used for legitimate purposes. [**Discord**](https://discordapp.com/users/1183040947035062382)
-->

## Installation
Read the [**Pre-Requisites**](https://github.com/diezo/Ensta/wiki/Pre%E2%80%90requisites) here.
Read the [**pre-requisites**](https://github.com/diezo/Ensta/wiki/Pre%E2%80%90requisites) here.

pip install ensta

## Example
Fetching profile info by username:
```python
from ensta import Web
from ensta import Mobile

host = Web(username, password)
mobile = Mobile(username, password)

profile = host.profile("leomessi")
profile = mobile.profile("leomessi")

print(profile.full_name)
print(profile.biography)
print(profile.is_private)
print(profile.profile_picture_url_hd)
print(profile.profile_pic_url)
```

## Features
Expand Down Expand Up @@ -471,6 +471,7 @@ mobile.clear_bio_links()
</details>

### Deprecated Features (Web API)
Features still using the **Web API**:

<details>

Expand Down Expand Up @@ -544,23 +545,30 @@ for user in likers.users:

</details>

They'll be migrated to the **Mobile API** soon.

## Supported Classes

> [!IMPORTANT]
> The **Web Class** is deprecated and it's features are being migrated to the **Mobile Class**. It'll be removed from Ensta upon completion.
<details>

<br>

<summary><b>Host Class</b> (Authenticated)</summary>
<summary><b>Mobile Class</b> (Authenticated)</summary>

Requires login, and has many features.
Requires login, and has the most features.

```python
from ensta import Web
from ensta import Mobile

host = Web(username, password)
profile = host.profile("leomessi")
mobile = Mobile(username, password)
profile = mobile.profile("leomessi")

print(profile.full_name)
print(profile.biography)
print(profile.profile_pic_url)
```

</details>
Expand All @@ -584,13 +592,30 @@ print(profile.biography)

</details>

<details>

<br>

<summary><b>Web Class</b> (Authenticated) <i>(Deprecated)</i></summary>

```python
from ensta import Web

host = Web(username, password)
profile = host.profile("leomessi")

print(profile.biography)
```

</details>

## Discord Community
Ask questions, discuss upcoming features and meet other developers.

[<img src="https://i.ibb.co/qdX7F1b/IMG-20240105-115646-modified-modified.png" width="150"/>](https://discord.com/invite/pU4knSwmQe)

## Support Me
Wish to support this project? Please consider buying me a coffee here:
## Buy Me A Coffee
Support me in the development of this project.

[<img src="https://raw.githubusercontent.com/diezo/Ensta/master/assets/coffee.svg" width="170"/>](https://buymeacoffee.com/sonii)

Expand Down
13 changes: 12 additions & 1 deletion ensta/Mobile.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,20 @@ def __init__(
save_folder: str = "ensta-sessions",
skip_auth_check: bool = False,
logging: bool = False,
totp_token : str = None,
totp_token: str = None,
session_data: str = None
) -> None:
"""
This classes uses Instagram's Mobile API. Authentication is required using username and password.
:param identifier: Account's Username or Email (For Login)
:param password: Account's Password (For Login)
:param proxy: (Optional) 'Requests' library compatible proxy dictionary.
:param save_folder: Directory where login sessions should be stored. Pass "" to disable storing sessions.
:param skip_auth_check: When 'True', checks whether the stored session is still valid. If no session is stored, it doesn't skip login.
:param logging: Enables logging for debugging.
:param totp_token: (Optional) Secret Token if TOTP-based 2FA is enabled on your account. Secret token looks like "823JAJID992JKD9JKJ", it's not the temporary code generated every 30 seconds by your Authenticator app.
:param session_data: (Optional) Session Data string to be used instead of the saved session inside 'ensta-sessions' directory. Useful when persistent storage isn't allowed on your device.
"""

self.session = Session()

Expand Down
9 changes: 0 additions & 9 deletions mobile_migration_checklist.md

This file was deleted.

0 comments on commit dd15a94

Please sign in to comment.