Ensta 5.2.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ensta-5.2.11/Ensta.egg-info/PKG-INFO +663 -0
- ensta-5.2.11/Ensta.egg-info/SOURCES.txt +78 -0
- ensta-5.2.11/Ensta.egg-info/dependency_links.txt +1 -0
- ensta-5.2.11/Ensta.egg-info/requires.txt +7 -0
- ensta-5.2.11/Ensta.egg-info/top_level.txt +1 -0
- ensta-5.2.11/LICENSE.txt +21 -0
- ensta-5.2.11/PKG-INFO +663 -0
- ensta-5.2.11/README.md +623 -0
- ensta-5.2.11/ensta/Authentication.py +252 -0
- ensta-5.2.11/ensta/Credentials.py +251 -0
- ensta-5.2.11/ensta/Direct.py +145 -0
- ensta-5.2.11/ensta/Guest.py +497 -0
- ensta-5.2.11/ensta/MediaResolver.py +20 -0
- ensta-5.2.11/ensta/Mobile.py +1125 -0
- ensta-5.2.11/ensta/PasswordEncryption.py +50 -0
- ensta-5.2.11/ensta/SessionManager.py +82 -0
- ensta-5.2.11/ensta/Utils.py +10 -0
- ensta-5.2.11/ensta/Web.py +121 -0
- ensta-5.2.11/ensta/WebSession.py +1408 -0
- ensta-5.2.11/ensta/__init__.py +11 -0
- ensta-5.2.11/ensta/containers/BaseResponseData.py +60 -0
- ensta-5.2.11/ensta/containers/DirectThread.py +74 -0
- ensta-5.2.11/ensta/containers/DirectThreadInviter.py +22 -0
- ensta-5.2.11/ensta/containers/DirectThreadLastPermanentItem.py +7 -0
- ensta-5.2.11/ensta/containers/FollowPerson.py +15 -0
- ensta-5.2.11/ensta/containers/FollowedStatus.py +10 -0
- ensta-5.2.11/ensta/containers/Inbox.py +10 -0
- ensta-5.2.11/ensta/containers/Liker.py +15 -0
- ensta-5.2.11/ensta/containers/Likers.py +9 -0
- ensta-5.2.11/ensta/containers/PhotoUpload.py +82 -0
- ensta-5.2.11/ensta/containers/Post.py +44 -0
- ensta-5.2.11/ensta/containers/PostDetail.py +102 -0
- ensta-5.2.11/ensta/containers/PostUser.py +22 -0
- ensta-5.2.11/ensta/containers/PrivateInfo.py +25 -0
- ensta-5.2.11/ensta/containers/Profile.py +36 -0
- ensta-5.2.11/ensta/containers/ProfileHost.py +16 -0
- ensta-5.2.11/ensta/containers/ReelUpload.py +109 -0
- ensta-5.2.11/ensta/containers/Shared.py +18 -0
- ensta-5.2.11/ensta/containers/UnfollowedStatus.py +8 -0
- ensta-5.2.11/ensta/containers/__init__.py +18 -0
- ensta-5.2.11/ensta/lib/Exceptions.py +61 -0
- ensta-5.2.11/ensta/lib/Searcher.py +83 -0
- ensta-5.2.11/ensta/lib/__init__.py +11 -0
- ensta-5.2.11/ensta/parser/AddedCommentParser.py +30 -0
- ensta-5.2.11/ensta/parser/AddedCommentUserParser.py +19 -0
- ensta-5.2.11/ensta/parser/BiographyLinkParser.py +17 -0
- ensta-5.2.11/ensta/parser/CaptionParser.py +22 -0
- ensta-5.2.11/ensta/parser/CarouselMediaParser.py +22 -0
- ensta-5.2.11/ensta/parser/FollowersListParser.py +26 -0
- ensta-5.2.11/ensta/parser/FollowersParser.py +19 -0
- ensta-5.2.11/ensta/parser/FollowingsListParser.py +27 -0
- ensta-5.2.11/ensta/parser/FollowingsParser.py +19 -0
- ensta-5.2.11/ensta/parser/ImageVersionsParser.py +18 -0
- ensta-5.2.11/ensta/parser/PrivateInfoParser.py +26 -0
- ensta-5.2.11/ensta/parser/ProfileParser.py +29 -0
- ensta-5.2.11/ensta/parser/UploadedPhotoParser.py +31 -0
- ensta-5.2.11/ensta/parser/UploadedSidecarParser.py +42 -0
- ensta-5.2.11/ensta/parser/__init__.py +14 -0
- ensta-5.2.11/ensta/structures/AddedComment.py +29 -0
- ensta-5.2.11/ensta/structures/AddedCommentUser.py +22 -0
- ensta-5.2.11/ensta/structures/BioLink.py +12 -0
- ensta-5.2.11/ensta/structures/Caption.py +25 -0
- ensta-5.2.11/ensta/structures/CarouselMedia.py +19 -0
- ensta-5.2.11/ensta/structures/Follower.py +21 -0
- ensta-5.2.11/ensta/structures/Followers.py +19 -0
- ensta-5.2.11/ensta/structures/Following.py +22 -0
- ensta-5.2.11/ensta/structures/Followings.py +19 -0
- ensta-5.2.11/ensta/structures/ImageVersion.py +16 -0
- ensta-5.2.11/ensta/structures/PrivateInfo.py +29 -0
- ensta-5.2.11/ensta/structures/Profile.py +26 -0
- ensta-5.2.11/ensta/structures/ReturnedBioLink.py +18 -0
- ensta-5.2.11/ensta/structures/SidecarChild.py +12 -0
- ensta-5.2.11/ensta/structures/StoryLink.py +22 -0
- ensta-5.2.11/ensta/structures/UploadedPhoto.py +31 -0
- ensta-5.2.11/ensta/structures/UploadedSidecar.py +39 -0
- ensta-5.2.11/ensta/structures/__init__.py +17 -0
- ensta-5.2.11/pyproject.toml +6 -0
- ensta-5.2.11/setup.cfg +7 -0
- ensta-5.2.11/setup.py +68 -0
|
@@ -0,0 +1,663 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: Ensta
|
|
3
|
+
Version: 5.2.11
|
|
4
|
+
Summary: 🔥 Python Library for Instagram Web & Mobile API Integration
|
|
5
|
+
Home-page: https://github.com/diezo/ensta
|
|
6
|
+
Download-URL: https://github.com/diezo/ensta/archive/refs/tags/v5.2.11.tar.gz
|
|
7
|
+
Author: Deepak Soni
|
|
8
|
+
Author-email: sonniiii@outlook.com
|
|
9
|
+
License: MIT
|
|
10
|
+
Keywords: instagram-client,instagram,api-wrapper,instagram-scraper,instagram-api,instagram-sdk,instagram-photos,instagram-api-python,instabot,instagram-stories,instagram-bot,instapy,instagram-downloader,instagram-account,instagram-crawler,instagram-private-api,igtv,instagram-automation,reels,instagram-feed
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE.txt
|
|
20
|
+
Requires-Dist: requests
|
|
21
|
+
Requires-Dist: moviepy
|
|
22
|
+
Requires-Dist: pillow
|
|
23
|
+
Requires-Dist: cryptography
|
|
24
|
+
Requires-Dist: pyotp
|
|
25
|
+
Requires-Dist: ntplib
|
|
26
|
+
Requires-Dist: pyquery
|
|
27
|
+
Dynamic: author
|
|
28
|
+
Dynamic: author-email
|
|
29
|
+
Dynamic: classifier
|
|
30
|
+
Dynamic: description
|
|
31
|
+
Dynamic: description-content-type
|
|
32
|
+
Dynamic: download-url
|
|
33
|
+
Dynamic: home-page
|
|
34
|
+
Dynamic: keywords
|
|
35
|
+
Dynamic: license
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
Dynamic: requires-dist
|
|
38
|
+
Dynamic: requires-python
|
|
39
|
+
Dynamic: summary
|
|
40
|
+
|
|
41
|
+
# Ensta - Simple Instagram API
|
|
42
|
+
[](https://pypi.org/project/ensta)
|
|
43
|
+
[]()
|
|
44
|
+
[](https://pepy.tech/project/ensta)
|
|
45
|
+
|
|
46
|
+

|
|
47
|
+
|
|
48
|
+
Ensta is a simple, reliable and up-to-date python package for Instagram API.
|
|
49
|
+
|
|
50
|
+
Both **authenticated** and **anonymous** requests are supported.
|
|
51
|
+
|
|
52
|
+
[<img style="margin-top: 10px" src="https://raw.githubusercontent.com/diezo/Ensta/master/assets/coffee.svg" width="180"/>](https://buymeacoffee.com/sonii)
|
|
53
|
+
|
|
54
|
+
<!-- ### Python & Instagram Automation Services
|
|
55
|
+
I'm available for freelance work in Python development with a focus on Instagram automation. If you have a project that requires expertise in automating tasks on Instagram, feel free to contact me at **sonniiii@outlook.com** or message me on discord [**@gitdiezo**](https://discordapp.com/users/1183040947035062382). -->
|
|
56
|
+
|
|
57
|
+
## Revive the Project! 🌟
|
|
58
|
+
Contribute to ensta and help revive the project for future updates and maintainance.
|
|
59
|
+
|
|
60
|
+
[<img src="https://raw.githubusercontent.com/diezo/Ensta/master/assets/coffee.svg" width="170"/>](https://buymeacoffee.com/sonii)
|
|
61
|
+
|
|
62
|
+
## Installation
|
|
63
|
+
Read the [**pre-requisites**](https://github.com/diezo/Ensta/wiki/Pre%E2%80%90requisites) here.
|
|
64
|
+
|
|
65
|
+
pip install ensta
|
|
66
|
+
|
|
67
|
+
## Example
|
|
68
|
+
Fetching profile info by username:
|
|
69
|
+
```python
|
|
70
|
+
from ensta import Mobile
|
|
71
|
+
|
|
72
|
+
mobile = Mobile(username, password)
|
|
73
|
+
|
|
74
|
+
profile = mobile.profile("leomessi")
|
|
75
|
+
|
|
76
|
+
print(profile.full_name)
|
|
77
|
+
print(profile.biography)
|
|
78
|
+
print(profile.profile_pic_url)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Features
|
|
82
|
+
These features use the **Mobile API**.
|
|
83
|
+
|
|
84
|
+
<details>
|
|
85
|
+
|
|
86
|
+
<summary>Using Proxies</summary><br>
|
|
87
|
+
|
|
88
|
+
When to use a proxy:
|
|
89
|
+
- You're being rate limited.
|
|
90
|
+
- Ensta is not working because your Home IP is flagged.
|
|
91
|
+
- You're deploying Ensta to the cloud. (Instagram blocks requests from IPs of cloud providers, so a proxy must be used)
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
from ensta import Mobile
|
|
95
|
+
|
|
96
|
+
mobile = Mobile(
|
|
97
|
+
username,
|
|
98
|
+
password,
|
|
99
|
+
proxy={
|
|
100
|
+
"http": "socks5://username:password@host:port",
|
|
101
|
+
"https": "socks5://username:password@host:port"
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Ensta uses the same proxy settings as the **requests** module.
|
|
107
|
+
|
|
108
|
+
</details>
|
|
109
|
+
|
|
110
|
+
<details>
|
|
111
|
+
|
|
112
|
+
<summary>Username-Password Login</summary><br>
|
|
113
|
+
|
|
114
|
+
Username is recommended to sign in. However, email can also be used.
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
from ensta import Mobile
|
|
118
|
+
|
|
119
|
+
# Recommended
|
|
120
|
+
mobile = Mobile(username, password)
|
|
121
|
+
|
|
122
|
+
# This also works
|
|
123
|
+
mobile = Mobile(email, password)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
</details>
|
|
127
|
+
|
|
128
|
+
<details>
|
|
129
|
+
|
|
130
|
+
<summary>Change Profile Picture</summary><br>
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
from ensta import Mobile
|
|
134
|
+
|
|
135
|
+
mobile = Mobile(username, password)
|
|
136
|
+
|
|
137
|
+
mobile.change_profile_picture("image.jpg")
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
</details>
|
|
141
|
+
|
|
142
|
+
<details>
|
|
143
|
+
|
|
144
|
+
<summary>Fetch Profile Information</summary><br>
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
from ensta import Mobile
|
|
148
|
+
|
|
149
|
+
mobile = Mobile(username, password)
|
|
150
|
+
|
|
151
|
+
profile = mobile.profile("leomessi")
|
|
152
|
+
|
|
153
|
+
print(profile.full_name)
|
|
154
|
+
print(profile.biography)
|
|
155
|
+
print(profile.follower_count)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
</details>
|
|
159
|
+
|
|
160
|
+
<details>
|
|
161
|
+
|
|
162
|
+
<summary>Follow/Unfollow Account</summary><br>
|
|
163
|
+
|
|
164
|
+
```python
|
|
165
|
+
from ensta import Mobile
|
|
166
|
+
|
|
167
|
+
mobile = Mobile(username, password)
|
|
168
|
+
|
|
169
|
+
mobile.follow("leomessi")
|
|
170
|
+
mobile.unfollow("leomessi")
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
</details>
|
|
174
|
+
|
|
175
|
+
<details>
|
|
176
|
+
|
|
177
|
+
<summary>Change Biography</summary><br>
|
|
178
|
+
|
|
179
|
+
```python
|
|
180
|
+
from ensta import Mobile
|
|
181
|
+
|
|
182
|
+
mobile = Mobile(username, password)
|
|
183
|
+
|
|
184
|
+
mobile.change_biography("New bio here.")
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
</details>
|
|
188
|
+
|
|
189
|
+
<details>
|
|
190
|
+
|
|
191
|
+
<summary>Switch to Private/Public Account</summary><br>
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
from ensta import Mobile
|
|
195
|
+
|
|
196
|
+
mobile = Mobile(username, password)
|
|
197
|
+
|
|
198
|
+
mobile.switch_to_private_account()
|
|
199
|
+
mobile.switch_to_public_account()
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
</details>
|
|
203
|
+
|
|
204
|
+
<details>
|
|
205
|
+
|
|
206
|
+
<summary>Username to UserID / UserID to Username</summary><br>
|
|
207
|
+
|
|
208
|
+
```python
|
|
209
|
+
from ensta import Mobile
|
|
210
|
+
|
|
211
|
+
mobile = Mobile(username, password)
|
|
212
|
+
|
|
213
|
+
mobile.username_to_userid("leomessi")
|
|
214
|
+
mobile.userid_to_username("12345678")
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
</details>
|
|
218
|
+
|
|
219
|
+
<details>
|
|
220
|
+
|
|
221
|
+
<summary>Like/Unlike Post</summary><br>
|
|
222
|
+
|
|
223
|
+
```python
|
|
224
|
+
from ensta import Mobile
|
|
225
|
+
|
|
226
|
+
mobile = Mobile(username, password)
|
|
227
|
+
|
|
228
|
+
mobile.like(media_id)
|
|
229
|
+
mobile.unlike(media_id)
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
</details>
|
|
233
|
+
|
|
234
|
+
<details>
|
|
235
|
+
|
|
236
|
+
<summary>Fetch Followers/Followings</summary><br>
|
|
237
|
+
|
|
238
|
+
```python
|
|
239
|
+
from ensta import Mobile
|
|
240
|
+
|
|
241
|
+
mobile = Mobile(username, password)
|
|
242
|
+
|
|
243
|
+
followers = mobile.followers("leomessi")
|
|
244
|
+
followings = mobile.followings("leomessi")
|
|
245
|
+
|
|
246
|
+
for user in followers.list:
|
|
247
|
+
print(user.full_name)
|
|
248
|
+
|
|
249
|
+
for user in followings.list:
|
|
250
|
+
print(user.full_name)
|
|
251
|
+
|
|
252
|
+
# Fetching next chunk
|
|
253
|
+
followers = mobile.followers(
|
|
254
|
+
"leomessi",
|
|
255
|
+
next_cursor=followers.next_cursor
|
|
256
|
+
)
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
</details>
|
|
260
|
+
|
|
261
|
+
<details>
|
|
262
|
+
|
|
263
|
+
<summary>Add Comment to Post</summary><br>
|
|
264
|
+
|
|
265
|
+
```python
|
|
266
|
+
from ensta import Mobile
|
|
267
|
+
|
|
268
|
+
mobile = Mobile(username, password)
|
|
269
|
+
|
|
270
|
+
mobile.comment("Hello", media_id)
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
</details>
|
|
274
|
+
|
|
275
|
+
<details>
|
|
276
|
+
|
|
277
|
+
<summary>Upload Photo</summary><br>
|
|
278
|
+
|
|
279
|
+
```python
|
|
280
|
+
from ensta import Mobile
|
|
281
|
+
|
|
282
|
+
mobile = Mobile(username, password)
|
|
283
|
+
|
|
284
|
+
mobile.upload_photo(
|
|
285
|
+
upload_id=upload_id,
|
|
286
|
+
caption="Hello"
|
|
287
|
+
)
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
</details>
|
|
291
|
+
|
|
292
|
+
<details>
|
|
293
|
+
|
|
294
|
+
<summary>Upload Sidecar (Multiple Photos)</summary><br>
|
|
295
|
+
|
|
296
|
+
```python
|
|
297
|
+
from ensta import Mobile
|
|
298
|
+
from ensta.structures import SidecarChild
|
|
299
|
+
|
|
300
|
+
mobile = Mobile(username, password)
|
|
301
|
+
|
|
302
|
+
mobile.upload_sidecar(
|
|
303
|
+
children=[
|
|
304
|
+
SidecarChild(uploda_id),
|
|
305
|
+
SidecarChild(uploda_id),
|
|
306
|
+
SidecarChild(uploda_id)
|
|
307
|
+
],
|
|
308
|
+
caption="Hello"
|
|
309
|
+
)
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
</details>
|
|
313
|
+
|
|
314
|
+
<details>
|
|
315
|
+
|
|
316
|
+
<summary>Fetch Private Information (Yours)</summary><br>
|
|
317
|
+
|
|
318
|
+
```python
|
|
319
|
+
from ensta import Mobile
|
|
320
|
+
|
|
321
|
+
mobile = Mobile(username, password)
|
|
322
|
+
|
|
323
|
+
account = mobile.private_info()
|
|
324
|
+
|
|
325
|
+
print(account.email)
|
|
326
|
+
print(account.account_type)
|
|
327
|
+
print(account.phone_number)
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
</details>
|
|
331
|
+
|
|
332
|
+
<details>
|
|
333
|
+
|
|
334
|
+
<summary>Update Display Name</summary><br>
|
|
335
|
+
|
|
336
|
+
```python
|
|
337
|
+
from ensta import Mobile
|
|
338
|
+
|
|
339
|
+
mobile = Mobile(username, password)
|
|
340
|
+
|
|
341
|
+
mobile.update_display_name("Lionel Messi")
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
</details>
|
|
345
|
+
|
|
346
|
+
<details>
|
|
347
|
+
|
|
348
|
+
<summary>Block/Unblock User</summary><br>
|
|
349
|
+
|
|
350
|
+
```python
|
|
351
|
+
from ensta import Mobile
|
|
352
|
+
|
|
353
|
+
mobile = Mobile(username, password)
|
|
354
|
+
|
|
355
|
+
mobile.block(123456789) # Use UserID
|
|
356
|
+
mobile.unblock(123456789) # Use UserID
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
</details>
|
|
360
|
+
|
|
361
|
+
<details>
|
|
362
|
+
|
|
363
|
+
<summary>Upload Story (Photo)</summary>
|
|
364
|
+
|
|
365
|
+
```python
|
|
366
|
+
from ensta import Mobile
|
|
367
|
+
|
|
368
|
+
mobile = Mobile(username, password)
|
|
369
|
+
|
|
370
|
+
upload_id = mobile.get_upload_id("image.jpg")
|
|
371
|
+
|
|
372
|
+
mobile.upload_story(upload_id)
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
</details>
|
|
376
|
+
|
|
377
|
+
<details>
|
|
378
|
+
|
|
379
|
+
<summary>Upload Story (Photo) + Link Sticker</summary>
|
|
380
|
+
|
|
381
|
+
```python
|
|
382
|
+
from ensta import Mobile
|
|
383
|
+
from ensta.structures import StoryLink
|
|
384
|
+
|
|
385
|
+
mobile = Mobile(username, password)
|
|
386
|
+
|
|
387
|
+
upload_id = mobile.get_upload_id("image.jpg")
|
|
388
|
+
|
|
389
|
+
mobile.upload_story(upload_id, entities=[
|
|
390
|
+
StoryLink(title="Google", url="https://google.com")
|
|
391
|
+
])
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
</details>
|
|
395
|
+
|
|
396
|
+
<details>
|
|
397
|
+
|
|
398
|
+
<summary>Send Message (Text)</summary>
|
|
399
|
+
|
|
400
|
+
```python
|
|
401
|
+
from ensta import Mobile
|
|
402
|
+
|
|
403
|
+
mobile = Mobile(username, password) # Or use email
|
|
404
|
+
direct = mobile.direct()
|
|
405
|
+
|
|
406
|
+
direct.send_text("Hello", thread_id)
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
</details>
|
|
410
|
+
|
|
411
|
+
<details>
|
|
412
|
+
|
|
413
|
+
<summary>Send Message (Picture)</summary>
|
|
414
|
+
|
|
415
|
+
```python
|
|
416
|
+
from ensta import Mobile
|
|
417
|
+
|
|
418
|
+
mobile = Mobile(username, password) # Or use email
|
|
419
|
+
direct = mobile.direct()
|
|
420
|
+
|
|
421
|
+
media_id = direct.fb_upload_image("image.jpg")
|
|
422
|
+
|
|
423
|
+
direct.send_photo(media_id, thread_id)
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
</details>
|
|
427
|
+
|
|
428
|
+
<details>
|
|
429
|
+
|
|
430
|
+
<summary>Add Biography Link</summary>
|
|
431
|
+
|
|
432
|
+
```python
|
|
433
|
+
from ensta import Mobile
|
|
434
|
+
|
|
435
|
+
mobile = Mobile(username, password) # Or use email
|
|
436
|
+
|
|
437
|
+
link_id = mobile.add_bio_link(
|
|
438
|
+
url="https://github.com/diezo",
|
|
439
|
+
title="Diezo's GitHub"
|
|
440
|
+
)
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
</details>
|
|
444
|
+
|
|
445
|
+
<details>
|
|
446
|
+
|
|
447
|
+
<summary>Add Multiple Biography Links</summary>
|
|
448
|
+
|
|
449
|
+
```python
|
|
450
|
+
from ensta import Mobile
|
|
451
|
+
from ensta.structures import BioLink
|
|
452
|
+
|
|
453
|
+
mobile = Mobile(username, password) # Or use email
|
|
454
|
+
|
|
455
|
+
link_ids = mobile.add_bio_links([
|
|
456
|
+
BioLink(url="https://example.com", title="Link 1"),
|
|
457
|
+
BioLink(url="https://example.com", title="Link 2"),
|
|
458
|
+
BioLink(url="https://example.com", title="Link 3")
|
|
459
|
+
])
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
</details>
|
|
463
|
+
|
|
464
|
+
<details>
|
|
465
|
+
|
|
466
|
+
<summary>Remove Biography Link</summary>
|
|
467
|
+
|
|
468
|
+
```python
|
|
469
|
+
from ensta import Mobile
|
|
470
|
+
|
|
471
|
+
mobile = Mobile(username, password) # Or use email
|
|
472
|
+
|
|
473
|
+
mobile.remove_bio_link(link_id)
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
</details>
|
|
477
|
+
|
|
478
|
+
<details>
|
|
479
|
+
|
|
480
|
+
<summary>Remove Multiple Biography Links</summary>
|
|
481
|
+
|
|
482
|
+
```python
|
|
483
|
+
from ensta import Mobile
|
|
484
|
+
|
|
485
|
+
mobile = Mobile(username, password) # Or use email
|
|
486
|
+
|
|
487
|
+
mobile.remove_bio_links([
|
|
488
|
+
link_id_1,
|
|
489
|
+
link_id_2,
|
|
490
|
+
link_id_3
|
|
491
|
+
])
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
</details>
|
|
495
|
+
|
|
496
|
+
<details>
|
|
497
|
+
|
|
498
|
+
<summary>Clear All Biography Links</summary>
|
|
499
|
+
|
|
500
|
+
```python
|
|
501
|
+
from ensta import Mobile
|
|
502
|
+
|
|
503
|
+
mobile = Mobile(username, password) # Or use email
|
|
504
|
+
|
|
505
|
+
mobile.clear_bio_links()
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
</details>
|
|
509
|
+
|
|
510
|
+
### Deprecated Features (Web API)
|
|
511
|
+
Features still using the **Web API**:
|
|
512
|
+
|
|
513
|
+
<details>
|
|
514
|
+
|
|
515
|
+
<summary>Upload Reel</summary><br>
|
|
516
|
+
|
|
517
|
+
```python
|
|
518
|
+
from ensta import Web
|
|
519
|
+
|
|
520
|
+
host = Web(username, password)
|
|
521
|
+
|
|
522
|
+
video_id = host.upload_video_for_reel("Video.mp4", thumbnail="Thumbnail.jpg")
|
|
523
|
+
|
|
524
|
+
host.pub_reel(
|
|
525
|
+
video_id,
|
|
526
|
+
caption="Enjoying the winter! ⛄"
|
|
527
|
+
)
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
</details>
|
|
531
|
+
|
|
532
|
+
<details>
|
|
533
|
+
|
|
534
|
+
<summary>Fetch Web Profile Data</summary><br>
|
|
535
|
+
|
|
536
|
+
```python
|
|
537
|
+
from ensta import Web
|
|
538
|
+
|
|
539
|
+
host = Web(username, password)
|
|
540
|
+
profile = host.profile("leomessi")
|
|
541
|
+
|
|
542
|
+
print(profile.full_name)
|
|
543
|
+
print(profile.biography)
|
|
544
|
+
print(profile.follower_count)
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
</details>
|
|
548
|
+
|
|
549
|
+
<details>
|
|
550
|
+
|
|
551
|
+
<summary>Fetch Someone's Feed</summary><br>
|
|
552
|
+
|
|
553
|
+
```python
|
|
554
|
+
from ensta import Web
|
|
555
|
+
|
|
556
|
+
host = Web(username, password)
|
|
557
|
+
posts = host.posts("leomessi", 100) # Want full list? Set count to '0'
|
|
558
|
+
|
|
559
|
+
for post in posts:
|
|
560
|
+
print(post.caption_text)
|
|
561
|
+
print(post.like_count)
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
</details>
|
|
565
|
+
|
|
566
|
+
<details>
|
|
567
|
+
|
|
568
|
+
<summary>Fetch Post's Likers</summary><br>
|
|
569
|
+
|
|
570
|
+
```python
|
|
571
|
+
from ensta import Web
|
|
572
|
+
|
|
573
|
+
host = Web(username, password)
|
|
574
|
+
|
|
575
|
+
post_id = host.get_post_id("https://www.instagram.com/p/Czr2yLmroCQ/")
|
|
576
|
+
likers = host.likers(post_id)
|
|
577
|
+
|
|
578
|
+
for user in likers.users:
|
|
579
|
+
print(user.username)
|
|
580
|
+
print(user.profile_picture_url)
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
</details>
|
|
584
|
+
|
|
585
|
+
They'll be migrated to the **Mobile API** soon.
|
|
586
|
+
|
|
587
|
+
## Supported Classes
|
|
588
|
+
|
|
589
|
+
> **Important:**
|
|
590
|
+
> The **Web Class** is deprecated and it's features are being migrated to the **Mobile Class**. It'll be removed from Ensta upon completion.
|
|
591
|
+
|
|
592
|
+
<details>
|
|
593
|
+
|
|
594
|
+
<br>
|
|
595
|
+
|
|
596
|
+
<summary><b>Mobile Class</b> (Authenticated)</summary>
|
|
597
|
+
|
|
598
|
+
Requires login, and has the most features.
|
|
599
|
+
|
|
600
|
+
```python
|
|
601
|
+
from ensta import Mobile
|
|
602
|
+
|
|
603
|
+
mobile = Mobile(username, password)
|
|
604
|
+
profile = mobile.profile("leomessi")
|
|
605
|
+
|
|
606
|
+
print(profile.full_name)
|
|
607
|
+
print(profile.biography)
|
|
608
|
+
print(profile.profile_pic_url)
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
</details>
|
|
612
|
+
|
|
613
|
+
<details>
|
|
614
|
+
|
|
615
|
+
<br>
|
|
616
|
+
|
|
617
|
+
<summary><b>Guest Class</b> (Non-Authenticated)</summary>
|
|
618
|
+
|
|
619
|
+
Doesn't require login, but has limited features.
|
|
620
|
+
|
|
621
|
+
```python
|
|
622
|
+
from ensta import Guest
|
|
623
|
+
|
|
624
|
+
guest = Guest()
|
|
625
|
+
profile = guest.profile("leomessi")
|
|
626
|
+
|
|
627
|
+
print(profile.biography)
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
</details>
|
|
631
|
+
|
|
632
|
+
<details>
|
|
633
|
+
|
|
634
|
+
<br>
|
|
635
|
+
|
|
636
|
+
<summary><b>Web Class</b> (Authenticated) <i>(Deprecated)</i></summary>
|
|
637
|
+
|
|
638
|
+
```python
|
|
639
|
+
from ensta import Web
|
|
640
|
+
|
|
641
|
+
host = Web(username, password)
|
|
642
|
+
profile = host.profile("leomessi")
|
|
643
|
+
|
|
644
|
+
print(profile.biography)
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
</details>
|
|
648
|
+
|
|
649
|
+
## Discord Community
|
|
650
|
+
Ask questions, discuss upcoming features and meet other developers.
|
|
651
|
+
|
|
652
|
+
[<img src="https://i.ibb.co/qdX7F1b/IMG-20240105-115646-modified-modified.png" width="150"/>](https://discord.com/invite/pU4knSwmQe)
|
|
653
|
+
|
|
654
|
+
## Buy Me A Coffee
|
|
655
|
+
Support me in the development of this project.
|
|
656
|
+
|
|
657
|
+
[<img src="https://raw.githubusercontent.com/diezo/Ensta/master/assets/coffee.svg" width="170"/>](https://buymeacoffee.com/sonii)
|
|
658
|
+
|
|
659
|
+
## Contributors
|
|
660
|
+
[](https://github.com/diezo/ensta/graphs/contributors)
|
|
661
|
+
|
|
662
|
+
## Disclaimer
|
|
663
|
+
This is a third party library and not associated with Instagram. We're strictly against spam. You are liable for all the actions you take.
|