aiograpi 0.0.1__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.
- aiograpi-0.0.1/PKG-INFO +35 -0
- aiograpi-0.0.1/README.md +150 -0
- aiograpi-0.0.1/aiograpi/__init__.py +106 -0
- aiograpi-0.0.1/aiograpi/config.py +42 -0
- aiograpi-0.0.1/aiograpi/exceptions.py +385 -0
- aiograpi-0.0.1/aiograpi/extractors.py +498 -0
- aiograpi-0.0.1/aiograpi/mixins/__init__.py +0 -0
- aiograpi-0.0.1/aiograpi/mixins/account.py +234 -0
- aiograpi-0.0.1/aiograpi/mixins/album.py +298 -0
- aiograpi-0.0.1/aiograpi/mixins/auth.py +893 -0
- aiograpi-0.0.1/aiograpi/mixins/bloks.py +56 -0
- aiograpi-0.0.1/aiograpi/mixins/challenge.py +555 -0
- aiograpi-0.0.1/aiograpi/mixins/clip.py +330 -0
- aiograpi-0.0.1/aiograpi/mixins/collection.py +205 -0
- aiograpi-0.0.1/aiograpi/mixins/comment.py +560 -0
- aiograpi-0.0.1/aiograpi/mixins/direct.py +703 -0
- aiograpi-0.0.1/aiograpi/mixins/fbsearch.py +92 -0
- aiograpi-0.0.1/aiograpi/mixins/graphql.py +232 -0
- aiograpi-0.0.1/aiograpi/mixins/hashtag.py +517 -0
- aiograpi-0.0.1/aiograpi/mixins/highlight.py +295 -0
- aiograpi-0.0.1/aiograpi/mixins/igtv.py +334 -0
- aiograpi-0.0.1/aiograpi/mixins/insights.py +213 -0
- aiograpi-0.0.1/aiograpi/mixins/location.py +528 -0
- aiograpi-0.0.1/aiograpi/mixins/media.py +1260 -0
- aiograpi-0.0.1/aiograpi/mixins/notification.py +564 -0
- aiograpi-0.0.1/aiograpi/mixins/password.py +66 -0
- aiograpi-0.0.1/aiograpi/mixins/photo.py +628 -0
- aiograpi-0.0.1/aiograpi/mixins/private.py +624 -0
- aiograpi-0.0.1/aiograpi/mixins/public.py +290 -0
- aiograpi-0.0.1/aiograpi/mixins/share.py +69 -0
- aiograpi-0.0.1/aiograpi/mixins/signup.py +321 -0
- aiograpi-0.0.1/aiograpi/mixins/story.py +406 -0
- aiograpi-0.0.1/aiograpi/mixins/timeline.py +98 -0
- aiograpi-0.0.1/aiograpi/mixins/totp.py +146 -0
- aiograpi-0.0.1/aiograpi/mixins/track.py +97 -0
- aiograpi-0.0.1/aiograpi/mixins/user.py +1216 -0
- aiograpi-0.0.1/aiograpi/mixins/video.py +886 -0
- aiograpi-0.0.1/aiograpi/reqwests.py +159 -0
- aiograpi-0.0.1/aiograpi/story.py +268 -0
- aiograpi-0.0.1/aiograpi/types.py +455 -0
- aiograpi-0.0.1/aiograpi/utils.py +110 -0
- aiograpi-0.0.1/aiograpi/zones.py +17 -0
- aiograpi-0.0.1/aiograpi.egg-info/PKG-INFO +35 -0
- aiograpi-0.0.1/aiograpi.egg-info/SOURCES.txt +47 -0
- aiograpi-0.0.1/aiograpi.egg-info/dependency_links.txt +1 -0
- aiograpi-0.0.1/aiograpi.egg-info/requires.txt +6 -0
- aiograpi-0.0.1/aiograpi.egg-info/top_level.txt +1 -0
- aiograpi-0.0.1/setup.cfg +4 -0
- aiograpi-0.0.1/setup.py +81 -0
aiograpi-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: aiograpi
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Asynchronous Instagram Private API wrapper
|
|
5
|
+
Home-page: https://github.com/subzeroid/aiograpi
|
|
6
|
+
Author: Mr.Robot
|
|
7
|
+
Author-email: mr.robot@example.org
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: instagram private api,instagram-private-api,instagram api,instagram-api,instagram,instagram-scraper,instagram-client,instagram-stories,instagram-feed,instagram-reels,instagram-insights,downloader,uploader,videos,photos,albums,igtv,reels,stories,pictures,instagram-user-photos,instagram-photos,instagram-metadata,instagram-downloader,instagram-uploader,instagram-note
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Requires-Python: >=3.10
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
Asynchronous Instagram Private API wrapper.
|
|
23
|
+
|
|
24
|
+
Use the most recent version of the API from Instagram.
|
|
25
|
+
|
|
26
|
+
Features:
|
|
27
|
+
|
|
28
|
+
1. Performs Public API (web, anonymous) or Private API (mobile app, authorized)
|
|
29
|
+
requests depending on the situation (to avoid Instagram limits)
|
|
30
|
+
2. Challenge Resolver have Email (as well as recipes for automating receive a code from email) and SMS handlers
|
|
31
|
+
3. Support upload a Photo, Video, IGTV, Clips (Reels), Albums and Stories
|
|
32
|
+
4. Support work with User, Media, Insights, Collections, Location (Place), Hashtag and Direct objects
|
|
33
|
+
5. Like, Follow, Edit account (Bio) and much more else
|
|
34
|
+
6. Insights by account, posts and stories
|
|
35
|
+
7. Build stories with custom background, font animation, swipe up link and mention users
|
aiograpi-0.0.1/README.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
If you want to work with aiograpi (business interests), we strongly advise you to prefer [HikerAPI](https://hikerapi.com/p/KhMxYMSn) project.
|
|
2
|
+
However, you won't need to spend weeks or even months setting it up.
|
|
3
|
+
The best service available today is [HikerAPI](https://hikerapi.com/p/KhMxYMSn), which handles 4–5 million daily requests, provides support around-the-clock, and offers partners a special rate.
|
|
4
|
+
In many instances, our clients tried to save money and preferred aiograpi, but in our experience, they ultimately returned to [HikerAPI](https://hikerapi.com/p/KhMxYMSn) after spending much more time and money.
|
|
5
|
+
It will be difficult to find good accounts, good proxies, or resolve challenges, and IG will ban your accounts.
|
|
6
|
+
|
|
7
|
+
The aiograpi more suits for testing or research than a working business!
|
|
8
|
+
|
|
9
|
+
### We recommend using our services:
|
|
10
|
+
|
|
11
|
+
* [LamaTok](https://lamatok.com/p/X0HatoxX) for TikTok API 🔥
|
|
12
|
+
* [HikerAPI](https://hikerapi.com/p/KhMxYMSn) for Instagram API ⚡⚡⚡
|
|
13
|
+
* [DataLikers](https://datalikers.com/p/XPhrh0Y3) for Instagram Datasets 🚀
|
|
14
|
+
|
|
15
|
+
[](https://github.com/subzeroid/aiograpi/actions/workflows/python-package.yml)
|
|
16
|
+
[](https://pypi.org/project/aiograpi/)
|
|
17
|
+

|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
Features:
|
|
22
|
+
|
|
23
|
+
* Getting public data of user, posts, stories, highlights, followers and following users
|
|
24
|
+
* Getting public email and phone number, if the user specified them in his business profile
|
|
25
|
+
* Getting public data of post, story, album, Reels, IGTV data and the ability to download content
|
|
26
|
+
* Getting public data of hashtag and location data, as well as a list of posts for them
|
|
27
|
+
* Getting public data of all comments on a post and a list of users who liked it
|
|
28
|
+
* Management of [proxy servers](https://soax.com/?r=sEysufQI), mobile devices and challenge resolver
|
|
29
|
+
* Login by username and password, sessionid and support 2FA
|
|
30
|
+
* Managing messages and threads for Direct and attach files
|
|
31
|
+
* Download and upload a Photo, Video, IGTV, Reels, Albums and Stories
|
|
32
|
+
* Work with Users, Posts, Comments, Insights, Collections, Location and Hashtag
|
|
33
|
+
* Insights by account, posts and stories
|
|
34
|
+
* Like, following, commenting, editing account (Bio) and much more else
|
|
35
|
+
|
|
36
|
+
# aiograpi - Unofficial Instagram API for Python
|
|
37
|
+
|
|
38
|
+
Fast and effective Instagram Private API wrapper (public+private requests and challenge resolver) without selenium. Use the most recent version of the API from Instagram, which was obtained using reverse-engineering with Charles Proxy and [Proxyman](https://proxyman.io/).
|
|
39
|
+
|
|
40
|
+
*Instagram API valid for **27 Feb 2024** (last reverse-engineering check)*
|
|
41
|
+
|
|
42
|
+
Support **Python >= 3.10**
|
|
43
|
+
|
|
44
|
+
For any other languages (e.g. C++, C#, F#, D, [Golang](https://github.com/subzeroid/instagrapi-rest/tree/main/golang), Erlang, Elixir, Nim, Haskell, Lisp, Closure, Julia, R, Java, Kotlin, Scala, OCaml, JavaScript, Crystal, Ruby, Rust, [Swift](https://github.com/subzeroid/instagrapi-rest/tree/main/swift), Objective-C, Visual Basic, .NET, Pascal, Perl, Lua, PHP and others), I suggest using [instagrapi-rest](https://github.com/subzeroid/instagrapi-rest)
|
|
45
|
+
|
|
46
|
+
[Support Chat in Telegram](https://t.me/instagrapi)
|
|
47
|
+
 and [GitHub Discussions](https://github.com/subzeroid/instagrapi/discussions)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## Features
|
|
51
|
+
|
|
52
|
+
1. Performs [Web API](https://subzeroid.github.io/aiograpi/usage-guide/fundamentals.html) or [Mobile API](https://subzeroid.github.io/aiograpi/usage-guide/fundamentals.html) requests depending on the situation (to avoid Instagram limits)
|
|
53
|
+
2. [Login](https://subzeroid.github.io/aiograpi/usage-guide/interactions.html) by username and password, including 2FA and by sessionid (and uses Authorization header instead Cookies)
|
|
54
|
+
3. [Challenge Resolver](https://subzeroid.github.io/aiograpi/usage-guide/challenge_resolver.html) have Email and SMS handlers
|
|
55
|
+
4. Support [upload](https://subzeroid.github.io/aiograpi/usage-guide/media.html) a Photo, Video, IGTV, Reels, Albums and Stories
|
|
56
|
+
5. Support work with [User](https://subzeroid.github.io/aiograpi/usage-guide/user.html), [Media](https://subzeroid.github.io/aiograpi/usage-guide/media.html), [Comment](https://subzeroid.github.io/aiograpi/usage-guide/comment.html), [Insights](https://subzeroid.github.io/aiograpi/usage-guide/insight.html), [Collections](https://subzeroid.github.io/aiograpi/usage-guide/collection.html), [Location](https://subzeroid.github.io/aiograpi/usage-guide/location.html) (Place), [Hashtag](https://subzeroid.github.io/aiograpi/usage-guide/hashtag.html) and [Direct Message](https://subzeroid.github.io/aiograpi/usage-guide/direct.html) objects
|
|
57
|
+
6. [Like](https://subzeroid.github.io/aiograpi/usage-guide/media.html), [Follow](https://subzeroid.github.io/aiograpi/usage-guide/user.html), [Edit account](https://subzeroid.github.io/aiograpi/usage-guide/account.html) (Bio) and much more else
|
|
58
|
+
7. [Insights](https://subzeroid.github.io/aiograpi/usage-guide/insight.html) by account, posts and stories
|
|
59
|
+
8. [Build stories](https://subzeroid.github.io/aiograpi/usage-guide/story.html) with custom background, font animation, link sticker and mention users
|
|
60
|
+
9. In the next release, account registration and captcha passing will appear
|
|
61
|
+
|
|
62
|
+
### Installation
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
pip install aiograpi
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Basic Usage
|
|
69
|
+
|
|
70
|
+
``` python
|
|
71
|
+
from aiograpi import Client
|
|
72
|
+
|
|
73
|
+
cl = Client()
|
|
74
|
+
await cl.login(ACCOUNT_USERNAME, ACCOUNT_PASSWORD)
|
|
75
|
+
|
|
76
|
+
user_id = await cl.user_id_from_username(ACCOUNT_USERNAME)
|
|
77
|
+
medias = await cl.user_medias(user_id, 20)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
<details>
|
|
81
|
+
<summary>Additional example</summary>
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from aiograpi import Client
|
|
85
|
+
from aiograpi.types import StoryMention, StoryMedia, StoryLink, StoryHashtag
|
|
86
|
+
|
|
87
|
+
cl = Client()
|
|
88
|
+
await cl.login(USERNAME, PASSWORD, verification_code="<2FA CODE HERE>")
|
|
89
|
+
|
|
90
|
+
media_pk = await cl.media_pk_from_url('https://www.instagram.com/p/CGgDsi7JQdS/')
|
|
91
|
+
media_path = await cl.video_download(media_pk)
|
|
92
|
+
subzeroid = await cl.user_info_by_username('subzeroid')
|
|
93
|
+
hashtag = await cl.hashtag_info('dhbastards')
|
|
94
|
+
|
|
95
|
+
await cl.video_upload_to_story(
|
|
96
|
+
media_path,
|
|
97
|
+
"Credits @subzeroid",
|
|
98
|
+
mentions=[StoryMention(user=subzeroid, x=0.49892962, y=0.703125, width=0.8333333333333334, height=0.125)],
|
|
99
|
+
links=[StoryLink(webUri='https://github.com/subzeroid/aiograpi')],
|
|
100
|
+
hashtags=[StoryHashtag(hashtag=hashtag, x=0.23, y=0.32, width=0.5, height=0.22)],
|
|
101
|
+
medias=[StoryMedia(media_pk=media_pk, x=0.5, y=0.5, width=0.6, height=0.8)]
|
|
102
|
+
)
|
|
103
|
+
```
|
|
104
|
+
</details>
|
|
105
|
+
|
|
106
|
+
## Documentation
|
|
107
|
+
|
|
108
|
+
* [Index](https://subzeroid.github.io/aiograpi/)
|
|
109
|
+
* [Getting Started](https://subzeroid.github.io/aiograpi/getting-started.html)
|
|
110
|
+
* [Usage Guide](https://subzeroid.github.io/aiograpi/usage-guide/fundamentals.html)
|
|
111
|
+
* [Interactions](https://subzeroid.github.io/aiograpi/usage-guide/interactions.html)
|
|
112
|
+
* [`Media`](https://subzeroid.github.io/aiograpi/usage-guide/media.html) - Publication (also called post): Photo, Video, Album, IGTV and Reels
|
|
113
|
+
* [`Resource`](https://subzeroid.github.io/aiograpi/usage-guide/media.html) - Part of Media (for albums)
|
|
114
|
+
* [`MediaOembed`](https://subzeroid.github.io/aiograpi/usage-guide/media.html) - Short version of Media
|
|
115
|
+
* [`Account`](https://subzeroid.github.io/aiograpi/usage-guide/account.html) - Full private info for your account (e.g. email, phone_number)
|
|
116
|
+
* [`TOTP`](https://subzeroid.github.io/aiograpi/usage-guide/totp.html) - 2FA TOTP helpers (generate seed, enable/disable TOTP, generate code as Google Authenticator)
|
|
117
|
+
* [`User`](https://subzeroid.github.io/aiograpi/usage-guide/user.html) - Full public user data
|
|
118
|
+
* [`UserShort`](https://subzeroid.github.io/aiograpi/usage-guide/user.html) - Short public user data (used in Usertag, Comment, Media, Direct Message)
|
|
119
|
+
* [`Usertag`](https://subzeroid.github.io/aiograpi/usage-guide/user.html) - Tag user in Media (coordinates + UserShort)
|
|
120
|
+
* [`Location`](https://subzeroid.github.io/aiograpi/usage-guide/location.html) - GEO location (GEO coordinates, name, address)
|
|
121
|
+
* [`Hashtag`](https://subzeroid.github.io/aiograpi/usage-guide/hashtag.html) - Hashtag object (id, name, picture)
|
|
122
|
+
* [`Collection`](https://subzeroid.github.io/aiograpi/usage-guide/collection.html) - Collection of medias (name, picture and list of medias)
|
|
123
|
+
* [`Comment`](https://subzeroid.github.io/aiograpi/usage-guide/comment.html) - Comments to Media
|
|
124
|
+
* [`Highlight`](https://subzeroid.github.io/aiograpi/usage-guide/highlight.html) - Highlights
|
|
125
|
+
* [`Notes`](https://subzeroid.github.io/aiograpi/usage-guide/notes.html) - Notes
|
|
126
|
+
* [`Story`](https://subzeroid.github.io/aiograpi/usage-guide/story.html) - Story
|
|
127
|
+
* [`StoryLink`](https://subzeroid.github.io/aiograpi/usage-guide/story.html) - Link Sticker
|
|
128
|
+
* [`StoryLocation`](https://subzeroid.github.io/aiograpi/usage-guide/story.html) - Tag Location in Story (as sticker)
|
|
129
|
+
* [`StoryMention`](https://subzeroid.github.io/aiograpi/usage-guide/story.html) - Mention users in Story (user, coordinates and dimensions)
|
|
130
|
+
* [`StoryHashtag`](https://subzeroid.github.io/aiograpi/usage-guide/story.html) - Hashtag for story (as sticker)
|
|
131
|
+
* [`StorySticker`](https://subzeroid.github.io/aiograpi/usage-guide/story.html) - Tag sticker to story (for example from giphy)
|
|
132
|
+
* [`StoryBuild`](https://subzeroid.github.io/aiograpi/usage-guide/story.html) - [StoryBuilder](/aiograpi/story.py) return path to photo/video and mention co-ordinates
|
|
133
|
+
* [`DirectThread`](https://subzeroid.github.io/aiograpi/usage-guide/direct.html) - Thread (topic) with messages in Direct Message
|
|
134
|
+
* [`DirectMessage`](https://subzeroid.github.io/aiograpi/usage-guide/direct.html) - Message in Direct Message
|
|
135
|
+
* [`Insight`](https://subzeroid.github.io/aiograpi/usage-guide/insight.html) - Insights for a post
|
|
136
|
+
* [`Track`](https://subzeroid.github.io/aiograpi/usage-guide/track.html) - Music track (for Reels/Clips)
|
|
137
|
+
* [Best Practices](https://subzeroid.github.io/aiograpi/usage-guide/best-practices.html)
|
|
138
|
+
* [Development Guide](https://subzeroid.github.io/aiograpi/development-guide.html)
|
|
139
|
+
* [Handle Exceptions](https://subzeroid.github.io/aiograpi/usage-guide/handle_exception.html)
|
|
140
|
+
* [Challenge Resolver](https://subzeroid.github.io/aiograpi/usage-guide/challenge_resolver.html)
|
|
141
|
+
* [Exceptions](https://subzeroid.github.io/aiograpi/exceptions.html)
|
|
142
|
+
|
|
143
|
+
## Contributing
|
|
144
|
+
|
|
145
|
+
[](https://github.com/subzeroid/aiograpi/graphs/contributors)
|
|
146
|
+
|
|
147
|
+
To release, you need to call the following commands:
|
|
148
|
+
|
|
149
|
+
python setup.py sdist
|
|
150
|
+
twine upload dist/*
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from urllib.parse import urlparse
|
|
3
|
+
|
|
4
|
+
from aiograpi.mixins.account import AccountMixin
|
|
5
|
+
from aiograpi.mixins.album import DownloadAlbumMixin, UploadAlbumMixin
|
|
6
|
+
from aiograpi.mixins.auth import LoginMixin
|
|
7
|
+
from aiograpi.mixins.bloks import BloksMixin
|
|
8
|
+
from aiograpi.mixins.challenge import ChallengeResolveMixin
|
|
9
|
+
from aiograpi.mixins.clip import DownloadClipMixin, UploadClipMixin
|
|
10
|
+
from aiograpi.mixins.collection import CollectionMixin
|
|
11
|
+
from aiograpi.mixins.comment import CommentMixin
|
|
12
|
+
from aiograpi.mixins.direct import DirectMixin
|
|
13
|
+
from aiograpi.mixins.track import TrackMixin
|
|
14
|
+
from aiograpi.mixins.fbsearch import FbSearchMixin
|
|
15
|
+
from aiograpi.mixins.hashtag import HashtagMixin
|
|
16
|
+
from aiograpi.mixins.highlight import HighlightMixin
|
|
17
|
+
from aiograpi.mixins.igtv import DownloadIGTVMixin, UploadIGTVMixin
|
|
18
|
+
from aiograpi.mixins.insights import InsightsMixin
|
|
19
|
+
from aiograpi.mixins.location import LocationMixin
|
|
20
|
+
from aiograpi.mixins.media import MediaMixin
|
|
21
|
+
from aiograpi.mixins.notification import NotificationMixin
|
|
22
|
+
from aiograpi.mixins.password import PasswordMixin
|
|
23
|
+
from aiograpi.mixins.photo import DownloadPhotoMixin, UploadPhotoMixin
|
|
24
|
+
from aiograpi.mixins.private import PrivateRequestMixin
|
|
25
|
+
from aiograpi.mixins.public import (
|
|
26
|
+
ProfilePublicMixin,
|
|
27
|
+
PublicRequestMixin,
|
|
28
|
+
TopSearchesPublicMixin,
|
|
29
|
+
)
|
|
30
|
+
from aiograpi.mixins.graphql import GraphQLRequestMixin
|
|
31
|
+
from aiograpi.mixins.share import ShareMixin
|
|
32
|
+
from aiograpi.mixins.signup import SignUpMixin
|
|
33
|
+
from aiograpi.mixins.story import StoryMixin
|
|
34
|
+
from aiograpi.mixins.timeline import ReelsMixin
|
|
35
|
+
from aiograpi.mixins.totp import TOTPMixin
|
|
36
|
+
from aiograpi.mixins.user import UserMixin
|
|
37
|
+
from aiograpi.mixins.video import DownloadVideoMixin, UploadVideoMixin
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class Client(
|
|
41
|
+
GraphQLRequestMixin,
|
|
42
|
+
PublicRequestMixin,
|
|
43
|
+
ChallengeResolveMixin,
|
|
44
|
+
PrivateRequestMixin,
|
|
45
|
+
TopSearchesPublicMixin,
|
|
46
|
+
ProfilePublicMixin,
|
|
47
|
+
LoginMixin,
|
|
48
|
+
ShareMixin,
|
|
49
|
+
TrackMixin,
|
|
50
|
+
FbSearchMixin,
|
|
51
|
+
HighlightMixin,
|
|
52
|
+
DownloadPhotoMixin,
|
|
53
|
+
UploadPhotoMixin,
|
|
54
|
+
DownloadVideoMixin,
|
|
55
|
+
UploadVideoMixin,
|
|
56
|
+
DownloadAlbumMixin,
|
|
57
|
+
NotificationMixin,
|
|
58
|
+
UploadAlbumMixin,
|
|
59
|
+
DownloadIGTVMixin,
|
|
60
|
+
UploadIGTVMixin,
|
|
61
|
+
MediaMixin,
|
|
62
|
+
UserMixin,
|
|
63
|
+
InsightsMixin,
|
|
64
|
+
CollectionMixin,
|
|
65
|
+
AccountMixin,
|
|
66
|
+
DirectMixin,
|
|
67
|
+
LocationMixin,
|
|
68
|
+
HashtagMixin,
|
|
69
|
+
CommentMixin,
|
|
70
|
+
StoryMixin,
|
|
71
|
+
PasswordMixin,
|
|
72
|
+
DownloadClipMixin,
|
|
73
|
+
UploadClipMixin,
|
|
74
|
+
ReelsMixin,
|
|
75
|
+
BloksMixin,
|
|
76
|
+
TOTPMixin,
|
|
77
|
+
SignUpMixin,
|
|
78
|
+
):
|
|
79
|
+
proxy = None
|
|
80
|
+
logger = logging.getLogger("aiograpi")
|
|
81
|
+
|
|
82
|
+
def __init__(
|
|
83
|
+
self, settings: dict = {}, proxy: str = None, delay_range: list = None, **kwargs
|
|
84
|
+
):
|
|
85
|
+
super().__init__(**kwargs)
|
|
86
|
+
self.settings = settings
|
|
87
|
+
self.delay_range = delay_range
|
|
88
|
+
self.set_proxy(proxy)
|
|
89
|
+
self.init()
|
|
90
|
+
|
|
91
|
+
def set_proxy(self, dsn: str):
|
|
92
|
+
if not dsn:
|
|
93
|
+
self.public.proxies = self.private.proxies = {}
|
|
94
|
+
return False
|
|
95
|
+
assert isinstance(
|
|
96
|
+
dsn, str
|
|
97
|
+
), f'Proxy must been string (URL), but now "{dsn}" ({type(dsn)})'
|
|
98
|
+
self.proxy = dsn
|
|
99
|
+
proxy_href = "{scheme}{href}".format(
|
|
100
|
+
scheme="http://" if not urlparse(self.proxy).scheme else "",
|
|
101
|
+
href=self.proxy,
|
|
102
|
+
)
|
|
103
|
+
self.public.proxies = self.private.proxies = self.graphql.proxies = {
|
|
104
|
+
"all://": proxy_href
|
|
105
|
+
}
|
|
106
|
+
return True
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
API_DOMAIN = "i.instagram.com"
|
|
2
|
+
|
|
3
|
+
# Instagram 134.0.0.26.121
|
|
4
|
+
# Android (26/8.0.0;
|
|
5
|
+
# 480dpi; 1080x1920; Xiaomi;
|
|
6
|
+
# MI 5s; capricorn; qcom; en_US; 205280538)
|
|
7
|
+
USER_AGENT_BASE = (
|
|
8
|
+
"Instagram {app_version} "
|
|
9
|
+
"Android ({android_version}/{android_release}; "
|
|
10
|
+
"{dpi}; {resolution}; {manufacturer}; "
|
|
11
|
+
"{model}; {device}; {cpu}; {locale}; {version_code})"
|
|
12
|
+
)
|
|
13
|
+
# Instagram 76.0.0.15.395 (iPhone9,2; iOS 10_0_2; en_US; en-US; scale=2.61; 1080x1920) AppleWebKit/420+
|
|
14
|
+
# Instagram 208.0.0.32.135 (iPhone; iOS 14_7_1; en_US; en-US; scale=2.61; 1080x1920) AppleWebKit/605.1.15
|
|
15
|
+
|
|
16
|
+
SOFTWARE = (
|
|
17
|
+
"{model}-user+{android_release}+OPR1.170623.032+V10.2.3.0.OAGMIXM+release-keys"
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
# QUERY_HASH_PROFILE = 'c9100bf9110dd6361671f113dd02e7d6'
|
|
21
|
+
# QUERY_HASH_MEDIAS = '42323d64886122307be10013ad2dcc44'
|
|
22
|
+
# QUERY_HASH_IGTVS = 'bc78b344a68ed16dd5d7f264681c4c76'
|
|
23
|
+
# QUERY_HASH_STORIES = '5ec1d322b38839230f8e256e1f638d5f'
|
|
24
|
+
# QUERY_HASH_HIGHLIGHTS_FOLDERS = 'ad99dd9d3646cc3c0dda65debcd266a7'
|
|
25
|
+
# QUERY_HASH_HIGHLIGHTS_STORIES = '5ec1d322b38839230f8e256e1f638d5f'
|
|
26
|
+
# QUERY_HASH_FOLLOWERS = 'c76146de99bb02f6415203be841dd25a'
|
|
27
|
+
# QUERY_HASH_FOLLOWINGS = 'd04b0a864b4b54837c0d870b0e77e076'
|
|
28
|
+
# QUERY_HASH_HASHTAG = '174a5243287c5f3a7de741089750ab3b'
|
|
29
|
+
# QUERY_HASH_COMMENTS = '33ba35852cb50da46f5b5e889df7d159'
|
|
30
|
+
# QUERY_HASH_TAGGED_MEDIAS = 'be13233562af2d229b008d2976b998b5'
|
|
31
|
+
|
|
32
|
+
LOGIN_EXPERIMENTS = "ig_android_reg_nux_headers_cleanup_universe,ig_android_device_detection_info_upload,ig_android_nux_add_email_device,ig_android_gmail_oauth_in_reg,ig_android_device_info_foreground_reporting,ig_android_device_verification_fb_signup,ig_android_direct_main_tab_universe_v2,ig_android_passwordless_account_password_creation_universe,ig_android_direct_add_direct_to_android_native_photo_share_sheet,ig_growth_android_profile_pic_prefill_with_fb_pic_2,ig_account_identity_logged_out_signals_global_holdout_universe,ig_android_quickcapture_keep_screen_on,ig_android_device_based_country_verification,ig_android_login_identifier_fuzzy_match,ig_android_reg_modularization_universe,ig_android_security_intent_switchoff,ig_android_device_verification_separate_endpoint,ig_android_suma_landing_page,ig_android_sim_info_upload,ig_android_smartlock_hints_universe,ig_android_fb_account_linking_sampling_freq_universe,ig_android_retry_create_account_universe,ig_android_caption_typeahead_fix_on_o_universe"
|
|
33
|
+
|
|
34
|
+
SUPPORTED_CAPABILITIES = [
|
|
35
|
+
{
|
|
36
|
+
"value": "119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0",
|
|
37
|
+
"name": "SUPPORTED_SDK_VERSIONS",
|
|
38
|
+
},
|
|
39
|
+
{"value": "14", "name": "FACE_TRACKER_VERSION"},
|
|
40
|
+
{"value": "ETC2_COMPRESSION", "name": "COMPRESSION"},
|
|
41
|
+
{"value": "gyroscope_enabled", "name": "gyroscope"},
|
|
42
|
+
]
|