diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index a20b47a5..aec41963 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,14 +7,7 @@ assignees: '' --- -### Compensate with donations ($15 and more) for the time I spent to fix problems or send me your [Pull Request](https://github.com/adw0rd/instagrapi/pulls) with fixes - -[![Donate](https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png)](https://www.buymeacoffee.com/adw0rd) - -* Tron TRX/USDT: `TLprxuzHjXPkHYa7ZfTTt165p7Fphwy1Ee` -* Bitcoin: `bc1qmp7538hktvg2gx994hrpkmsmyjc03q29awe9ra` -* Ethereum: `0x0E674815d513d4a00F6a7Cd4A990807aB97cC70D` -* Dogecoin: `DSEXzMBYhBTwhNqzPGxVWFsTqVsTCeDejo` +### Try Instagrapi SaaS with a free trial https://hikerapi.com/p/5GBWznd3 **Describe the bug** A clear and concise description of what the bug is. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 3f77cd31..1b343843 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -7,14 +7,7 @@ assignees: '' --- -### Compensate with donations ($20 and more) for the time I spent to implement new functionality or send me your [Pull Request](https://github.com/adw0rd/instagrapi/pulls) with your implementation of the new functionality - -[![Donate](https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png)](https://www.buymeacoffee.com/adw0rd) - -* Tron TRX/USDT: `TLprxuzHjXPkHYa7ZfTTt165p7Fphwy1Ee` -* Bitcoin: `bc1qmp7538hktvg2gx994hrpkmsmyjc03q29awe9ra` -* Ethereum: `0x0E674815d513d4a00F6a7Cd4A990807aB97cC70D` -* Dogecoin: `DSEXzMBYhBTwhNqzPGxVWFsTqVsTCeDejo` +### Try Instagrapi SaaS with a free trial https://hikerapi.com/p/5GBWznd3 **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ff0d5b2e..483dfc50 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,21 +1,21 @@ # Contributing When contributing to this repository, please first discuss the change you wish to make via issue, -email, or any other method with the owners of this repository before making a change. +email, or any other method with the owners of this repository before making a change. Please note we have a code of conduct, please follow it in all your interactions with the project. ## Pull Request Process -1. Ensure any install or build dependencies are removed before the end of the layer when doing a +1. Ensure any install or build dependencies are removed before the end of the layer when doing a build. -2. Add or change [unittests](/tests.py) that are specific to functionality according to [Development Guide](https://adw0rd.github.io/instagrapi/development-guide.html) +2. Add or change [unittests](/tests.py) that are specific to functionality according to [Development Guide](https://subzeroid.github.io/instagrapi/development-guide.html) 3. Add documentation about your methods and changes to [docs](/docs) -4. Update the README.md with details of changes to the interface, this includes new environment +4. Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters. 5. Increase the version number in [setup.py](/setup.py) and date of last reverse-engineering in the README.md to the new version that this Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). -6. You may merge the Pull Request in once you have the sign-off of two other developers, or if you +6. You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you. ## Code of Conduct diff --git a/LICENSE b/LICENSE index 181a4fbf..e1fd273f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Mikhail Andreev +Copyright (c) 2023 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/SECURITY.md b/SECURITY.md index a0737ce9..9fbd15c3 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -11,4 +11,4 @@ Only the latest versions are supported ## Reporting a Vulnerability -Report vulnerabilities in the telegram channel https://t.me/instagrapi or https://github.com/adw0rd/instagrapi/issues +Report vulnerabilities in the telegram channel https://t.me/instagrapi or https://github.com/subzeroid/instagrapi/issues diff --git a/docs/getting-started.md b/docs/getting-started.md index e56a1508..a89bc5c7 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -10,7 +10,7 @@ python -m pip install instagrapi ## Introduction -`instagrapi` is a fast and effective Instagram Private API wrapper (public+private requests and challenge resolver). Use the most recent version of the API from Instagram, which was obtained using [reverse-engineering with Charles Proxy](https://adw0rd.com/2020/03/26/sniffing-instagram-charles-proxy/en/) and [Proxyman](https://proxyman.io/). +`instagrapi` is a fast and effective Instagram Private API wrapper (public+private requests and challenge resolver). Use the most recent version of the API from Instagram, which was obtained using [reverse-engineering with Charles Proxy](https://github.com/subzeroid/instagrapi/discussions/1182) and [Proxyman](https://proxyman.io/). ## What's Next? diff --git a/docs/index.md b/docs/index.md index f6d3d2c2..85b4231f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,30 +1,30 @@ # instagrapi -[![Package](https://github.com/adw0rd/instagrapi/actions/workflows/python-package.yml/badge.svg?branch=master)](https://github.com/adw0rd/instagrapi/actions/workflows/python-package.yml) +[![Package](https://github.com/subzeroid/instagrapi/actions/workflows/python-package.yml/badge.svg?branch=master)](https://github.com/subzeroid/instagrapi/actions/workflows/python-package.yml) [![PyPI](https://img.shields.io/pypi/v/instagrapi)][pypi] [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/instagrapi)][pypi] -Fast and effective Instagram Private API wrapper (public+private requests and challenge resolver). Use the most recent version of the API from Instagram, which was obtained using [reverse-engineering with Charles Proxy](https://adw0rd.com/2020/03/26/sniffing-instagram-charles-proxy/en/) and [Proxyman](https://proxyman.io/). +Fast and effective Instagram Private API wrapper (public+private requests and challenge resolver). Use the most recent version of the API from Instagram, which was obtained using [reverse-engineering with Charles Proxy](https://github.com/subzeroid/instagrapi/discussions/1182) and [Proxyman](https://proxyman.io/). *Instagram API valid for **13 February 2023** (last reverse-engineering check)* Support **Python >= 3.8** -For any other languages (e.g. C++, C#, F#, D, [Golang](https://github.com/adw0rd/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/adw0rd/instagrapi-rest/tree/main/swift), Objective-C, Visual Basic, .NET, Pascal, Perl, Lua, PHP and others), I suggest using [instagrapi-rest](https://github.com/adw0rd/instagrapi-rest) +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) [Support Chat in Telegram](https://t.me/instagrapi) -![](https://gist.githubusercontent.com/m8rge/4c2b36369c9f936c02ee883ca8ec89f1/raw/c03fd44ee2b63d7a2a195ff44e9bb071e87b4a40/telegram-single-path-24px.svg) and [GitHub Discussions](https://github.com/adw0rd/instagrapi/discussions) +![](https://gist.githubusercontent.com/m8rge/4c2b36369c9f936c02ee883ca8ec89f1/raw/c03fd44ee2b63d7a2a195ff44e9bb071e87b4a40/telegram-single-path-24px.svg) and [GitHub Discussions](https://github.com/subzeroid/instagrapi/discussions) ## Features -1. Performs [Public API](https://adw0rd.github.io/instagrapi/usage-guide/fundamentals.html) (web, anonymous) or [Private API](https://adw0rd.github.io/instagrapi/usage-guide/fundamentals.html) (mobile app, authorized) requests depending on the situation (to avoid Instagram limits) -2. [Login](https://adw0rd.github.io/instagrapi/usage-guide/interactions.html) by username and password, including 2FA and by sessionid -3. [Challenge Resolver](https://adw0rd.github.io/instagrapi/usage-guide/challenge_resolver.html) have Email and SMS handlers -4. Support [upload](https://adw0rd.github.io/instagrapi/usage-guide/media.html) a Photo, Video, IGTV, Reels, Albums and Stories -5. Support work with [User](https://adw0rd.github.io/instagrapi/usage-guide/user.html), [Media](https://adw0rd.github.io/instagrapi/usage-guide/media.html), [Comment](https://adw0rd.github.io/instagrapi/usage-guide/comment.html), [Insights](https://adw0rd.github.io/instagrapi/usage-guide/insight.html), [Collections](https://adw0rd.github.io/instagrapi/usage-guide/collection.html), [Location](https://adw0rd.github.io/instagrapi/usage-guide/location.html) (Place), [Hashtag](https://adw0rd.github.io/instagrapi/usage-guide/hashtag.html) and [Direct Message](https://adw0rd.github.io/instagrapi/usage-guide/direct.html) objects -6. [Like](https://adw0rd.github.io/instagrapi/usage-guide/media.html), [Follow](https://adw0rd.github.io/instagrapi/usage-guide/user.html), [Edit account](https://adw0rd.github.io/instagrapi/usage-guide/account.html) (Bio) and much more else -7. [Insights](https://adw0rd.github.io/instagrapi/usage-guide/insight.html) by account, posts and stories -8. [Build stories](https://adw0rd.github.io/instagrapi/usage-guide/story.html) with custom background, font animation, swipe up link and mention users +1. Performs [Public API](https://subzeroid.github.io/instagrapi/usage-guide/fundamentals.html) (web, anonymous) or [Private API](https://subzeroid.github.io/instagrapi/usage-guide/fundamentals.html) (mobile app, authorized) requests depending on the situation (to avoid Instagram limits) +2. [Login](https://subzeroid.github.io/instagrapi/usage-guide/interactions.html) by username and password, including 2FA and by sessionid +3. [Challenge Resolver](https://subzeroid.github.io/instagrapi/usage-guide/challenge_resolver.html) have Email and SMS handlers +4. Support [upload](https://subzeroid.github.io/instagrapi/usage-guide/media.html) a Photo, Video, IGTV, Reels, Albums and Stories +5. Support work with [User](https://subzeroid.github.io/instagrapi/usage-guide/user.html), [Media](https://subzeroid.github.io/instagrapi/usage-guide/media.html), [Comment](https://subzeroid.github.io/instagrapi/usage-guide/comment.html), [Insights](https://subzeroid.github.io/instagrapi/usage-guide/insight.html), [Collections](https://subzeroid.github.io/instagrapi/usage-guide/collection.html), [Location](https://subzeroid.github.io/instagrapi/usage-guide/location.html) (Place), [Hashtag](https://subzeroid.github.io/instagrapi/usage-guide/hashtag.html) and [Direct Message](https://subzeroid.github.io/instagrapi/usage-guide/direct.html) objects +6. [Like](https://subzeroid.github.io/instagrapi/usage-guide/media.html), [Follow](https://subzeroid.github.io/instagrapi/usage-guide/user.html), [Edit account](https://subzeroid.github.io/instagrapi/usage-guide/account.html) (Bio) and much more else +7. [Insights](https://subzeroid.github.io/instagrapi/usage-guide/insight.html) by account, posts and stories +8. [Build stories](https://subzeroid.github.io/instagrapi/usage-guide/story.html) with custom background, font animation, swipe up link and mention users 9. In the next release, account registration and captcha passing will appear ## Example @@ -37,7 +37,7 @@ from instagrapi import Client cl = Client() cl.login(ACCOUNT_USERNAME, ACCOUNT_PASSWORD) -user_id = cl.user_id_from_username("adw0rd") +user_id = cl.user_id_from_username("example") medias = cl.user_medias(user_id, 20) ``` @@ -52,14 +52,14 @@ cl.login(USERNAME, PASSWORD, verification_code="<2FA CODE HERE>") media_pk = cl.media_pk_from_url('https://www.instagram.com/p/CGgDsi7JQdS/') media_path = cl.video_download(media_pk) -adw0rd = cl.user_info_by_username('adw0rd') +example = cl.user_info_by_username('example') hashtag = cl.hashtag_info('dhbastards') cl.video_upload_to_story( media_path, - "Credits @adw0rd", - mentions=[StoryMention(user=adw0rd, x=0.49892962, y=0.703125, width=0.8333333333333334, height=0.125)], - links=[StoryLink(webUri='https://github.com/adw0rd/instagrapi')], + "Credits @example", + mentions=[StoryMention(user=example, x=0.49892962, y=0.703125, width=0.8333333333333334, height=0.125)], + links=[StoryLink(webUri='https://github.com/subzeroid/instagrapi')], hashtags=[StoryHashtag(hashtag=hashtag, x=0.23, y=0.32, width=0.5, height=0.22)], medias=[StoryMedia(media_pk=media_pk, x=0.5, y=0.5, width=0.6, height=0.8)] ) @@ -67,7 +67,7 @@ cl.video_upload_to_story( ### Requests -* `Public` (anonymous request via web api) methods have a suffix `_gql` (Instagram `GraphQL`) or `_a1` (example `https://www.instagram.com/adw0rd/?__a=1`) +* `Public` (anonymous request via web api) methods have a suffix `_gql` (Instagram `GraphQL`) or `_a1` (example `https://www.instagram.com/example/?__a=1`) * `Private` (authorized request via mobile api) methods have `_v1` suffix The first request to fetch media/user is `public` (anonymous), if instagram raise exception, then use `private` (authorized). @@ -110,7 +110,7 @@ To learn more about the various ways `instagrapi` can be used, read the [Usage G * [`StoryMention`](usage-guide/story.md) - Mention users in Story (user, coordinates and dimensions) * [`StoryHashtag`](usage-guide/story.md) - Hashtag for story (as sticker) * [`StorySticker`](usage-guide/story.md) - Tag sticker to story (for example from giphy) - * [`StoryBuild`](usage-guide/story.md) - [StoryBuilder](https://github.com/adw0rd/instagrapi/blob/master/instagrapi/story.py) return path to photo/video and mention co-ordinates + * [`StoryBuild`](usage-guide/story.md) - [StoryBuilder](https://github.com/subzeroid/instagrapi/blob/master/instagrapi/story.py) return path to photo/video and mention co-ordinates * [`DirectThread`](usage-guide/direct.md) - Thread (topic) with messages in Direct Message * [`DirectMessage`](usage-guide/direct.md) - Message in Direct Message * [`Insight`](usage-guide/insight.md) - Insights for a post @@ -121,5 +121,5 @@ To learn more about the various ways `instagrapi` can be used, read the [Usage G * [Challenge Resolver](usage-guide/challenge_resolver.md) * [Exceptions](exceptions.md) -[ci]: https://github.com/adw0rd/instagrapi/actions +[ci]: https://github.com/subzeroid/instagrapi/actions [pypi]: https://pypi.org/project/instagrapi/ diff --git a/docs/usage-guide/account.md b/docs/usage-guide/account.md index 6c72acb5..45dbc44b 100644 --- a/docs/usage-guide/account.md +++ b/docs/usage-guide/account.md @@ -18,30 +18,30 @@ Example: >>> cl.login(USERNAME, PASSWORD) >>> cl.account_info().dict() {'pk': 1903424587, - 'username': 'adw0rd', - 'full_name': 'Mikhail Andreev', + 'username': 'example', + 'full_name': 'Example Example', 'is_private': False, 'profile_pic_url': HttpUrl('https://instagram.frix7-1.fna.fbcdn.net/v/t51.2885-19/s150x150/200092102_504535360754500_904902738723095864_n.jpg?tp=1&_nc_ht=instagram.frix7-1.fna.fbcdn.net&_nc_ohc=T2ZT6yA6XzoAX9MvAQA&edm=AJlpnE4BAAAA&ccb=7-4&oh=3865b51bb33b365c9de8bcf9775e519c&oe=60E982F2&_nc_sid=312772'), 'is_verified': False, 'biography': 'Engineer: Python, JavaScript, Erlang, Go, Swift\n@dhbastards \n@bestskatetrick \n@asphalt_kings_lb \n@best_drift_daily \n@wrclive \n@surferyone \n@bmxtravel', - 'external_url': 'https://adw0rd.com/', + 'external_url': 'https://example.org/', 'is_business': False, 'birthday': '1984-01-01', 'phone_number': '+79991234567', 'gender': 1, 'email': '...@gmail.com'} ->>> cl.account_edit(external_url='https://github.com/adw0rd/instagrapi') -Account(pk=1903424587, username='adw0rd', ..., external_url='https://github.com/adw0rd/instagrapi') +>>> cl.account_edit(external_url='https://github.com/subzeroid/instagrapi') +Account(pk=1903424587, username='example', ..., external_url='https://github.com/subzeroid/instagrapi') >>> media_pk = cl.media_pk_from_url('https://www.instagram.com/p/BWnh360Fitr/') 1560364774164147051 >>> profile_pic_path = cl.photo_download(media_pk, folder='/tmp') -PosixPath('/tmp/adw0rd_1560364774164147051.jpg') +PosixPath('/tmp/example_1560364774164147051.jpg') >>> cl.account_change_picture(profile_pic_path) -UserShort(pk=1903424587, username='adw0rd', ...) +UserShort(pk=1903424587, username='example', ...) >>> cl.send_confirm_email("addr@example.com") { diff --git a/docs/usage-guide/challenge_resolver.md b/docs/usage-guide/challenge_resolver.md index e1de6ffc..7ebe82f9 100644 --- a/docs/usage-guide/challenge_resolver.md +++ b/docs/usage-guide/challenge_resolver.md @@ -3,7 +3,7 @@ You can automatically change your password to solve the challenge from Instagram. -Declare `change_password_handler` which will return a new password. +Declare `change_password_handler` which will return a new password. ``` python def change_password_handler(username): @@ -77,6 +77,6 @@ def get_code_from_email(username): return False ``` -All challenges solved in the module [challenge.py](https://github.com/adw0rd/instagrapi/blob/master/instagrapi/mixins/challenge.py) +All challenges solved in the module [challenge.py](https://github.com/subzeroid/instagrapi/blob/master/instagrapi/mixins/challenge.py) -Automatic submission code from SMS/Email in examples [here](https://github.com/adw0rd/instagrapi/blob/master/examples/challenge_resolvers.py) +Automatic submission code from SMS/Email in examples [here](https://github.com/subzeroid/instagrapi/blob/master/examples/challenge_resolvers.py) diff --git a/docs/usage-guide/comment.md b/docs/usage-guide/comment.md index 8d6b27e8..326c4e6e 100644 --- a/docs/usage-guide/comment.md +++ b/docs/usage-guide/comment.md @@ -29,8 +29,8 @@ Example: {'pk': 17926777897585108, 'text': 'Test comment', 'user': {'pk': 1903424587, - 'username': 'adw0rd', - 'full_name': 'Mikhail Andreev', + 'username': 'example', + 'full_name': 'Example Example', 'profile_pic_url': HttpUrl('https://scontent-hel3-1.cdninstagram.com/v/t51.2885-19/s150x150/156689363_269505058076642_6448820957073669709_n.jpg?tp=1&_nc_ht=scontent-hel3-1.cdninstagram.com&_nc_ohc=EtzrL0pAdg8AX9pE_wN&edm=ABQSlwABAAAA&ccb=7-4&oh=e04d45b7651140e7fef61b1f67f1f408&oe=60C65AD1&_nc_sid=b2b2bd', scheme='https', host='scontent-hel3-1.cdninstagram.com', tld='com', host_type='domain', path='/v/t51.2885-19/s150x150/156689363_269505058076642_6448820957073669709_n.jpg', query='tp=1&_nc_ht=scontent-hel3-1.cdninstagram.com&_nc_ohc=EtzrL0pAdg8AX9pE_wN&edm=ABQSlwABAAAA&ccb=7-4&oh=e04d45b7651140e7fef61b1f67f1f408&oe=60C65AD1&_nc_sid=b2b2bd'), 'stories': []}, 'created_at_utc': datetime.datetime(2021, 5, 15, 14, 50, 3, tzinfo=datetime.timezone.utc), @@ -44,8 +44,8 @@ Example: {'pk': 17926777897585109, 'text': 'Test comment 2', 'user': {'pk': 1903424587, - 'username': 'adw0rd', - 'full_name': 'Mikhail Andreev', + 'username': 'example', + 'full_name': 'Example Example', 'profile_pic_url': HttpUrl('https://scontent-hel3-1.cdninstagram.com/v/t51.2885-19/s150x150/156689363_269505058076642_6448820957073669709_n.jpg?tp=1&_nc_ht=scontent-hel3-1.cdninstagram.com&_nc_ohc=EtzrL0pAdg8AX9pE_wN&edm=ABQSlwABAAAA&ccb=7-4&oh=e04d45b7651140e7fef61b1f67f1f408&oe=60C65AD1&_nc_sid=b2b2bd', scheme='https', host='scontent-hel3-1.cdninstagram.com', tld='com', host_type='domain', path='/v/t51.2885-19/s150x150/156689363_269505058076642_6448820957073669709_n.jpg', query='tp=1&_nc_ht=scontent-hel3-1.cdninstagram.com&_nc_ohc=EtzrL0pAdg8AX9pE_wN&edm=ABQSlwABAAAA&ccb=7-4&oh=e04d45b7651140e7fef61b1f67f1f408&oe=60C65AD1&_nc_sid=b2b2bd'), 'stories': []}, 'created_at_utc': datetime.datetime(2021, 5, 15, 14, 50, 3, tzinfo=datetime.timezone.utc), @@ -59,8 +59,8 @@ Example: {'pk': 17926777897585108, 'text': 'Test comment', 'user': {'pk': 1903424587, - 'username': 'adw0rd', - 'full_name': 'Mikhail Andreev', + 'username': 'example', + 'full_name': 'Example Example', 'profile_pic_url': HttpUrl('https://scontent-hel3-1.cdninstagram.com/v/t51.2885-19/s150x150/156689363_269505058076642_6448820957073669709_n.jpg?tp=1&_nc_ht=scontent-hel3-1.cdninstagram.com&_nc_ohc=EtzrL0pAdg8AX9pE_wN&edm=AId3EpQBAAAA&ccb=7-4&oh=e3fbafcdb63cec3535004e85eb3397ae&oe=60C65AD1&_nc_sid=705020', scheme='https', host='scontent-hel3-1.cdninstagram.com', tld='com', host_type='domain', path='/v/t51.2885-19/s150x150/156689363_269505058076642_6448820957073669709_n.jpg', query='tp=1&_nc_ht=scontent-hel3-1.cdninstagram.com&_nc_ohc=EtzrL0pAdg8AX9pE_wN&edm=AId3EpQBAAAA&ccb=7-4&oh=e3fbafcdb63cec3535004e85eb3397ae&oe=60C65AD1&_nc_sid=705020'), 'stories': []}, 'created_at_utc': datetime.datetime(2021, 5, 15, 14, 50, 3, tzinfo=datetime.timezone.utc), diff --git a/docs/usage-guide/direct.md b/docs/usage-guide/direct.md index e71a449e..ae6af47a 100644 --- a/docs/usage-guide/direct.md +++ b/docs/usage-guide/direct.md @@ -104,12 +104,12 @@ DirectMessage(id=300775273512312312312321568, user_id=None, thread_id=3402823612 >>> video_path = cl.video_download(cl.media_pk_from_url('https://www.instagram.com/p/B3rFQPblq40/')) >>> cl.direct_send_video(video_path, user_ids=[cl.user_id]) # or >>> cl.direct_send_video(video_path, thread_ids=[thread.id]) -Analyzing video file "/.../adw0rd_2155839952940084788.mp4" +Analyzing video file "/.../example_2155839952940084788.mp4" DirectMessage(id=300775489123123123123664, user_id=None, thread_id=34012312312312312398762, timestamp=datetime.datetime(2021, 9, 1, 14, 39, 56, 959454, tzinfo=datetime.timezone.utc), item_type=None, is_shh_mode=None, reactions=None, text=None, animated_media=None, media=None, media_share=None, reel_share=None, story_share=None, felix_share=None, clip=None, placeholder=None) >>> cl.video_upload_to_direct(video_path, thread_ids=[thread.id]) -Analyzing video file "/.../adw0rd_2155839952940084788.mp4" -Generating thumbnail "/.../adw0rd_2155839952940084788.mp4.jpg"... +Analyzing video file "/.../example_2155839952940084788.mp4" +Generating thumbnail "/.../example_2155839952940084788.mp4.jpg"... DirectMessage(id=3007123123123123664, user_id=None, thread_id=3401212312312312398762, timestamp=datetime.datetime(2021, 9, 1, 14, 39, 56, 959454, tzinfo=datetime.timezone.utc), item_type=None, is_shh_mode=None, reactions=None, text=None, animated_media=None, media=None, media_share=None, reel_share=None, story_share=None, felix_share=None, clip=None, placeholder=None) >>> cl.direct_thread_mark_unread(340282366841710301949128122292511813703) diff --git a/docs/usage-guide/fundamentals.md b/docs/usage-guide/fundamentals.md index a3142c7e..6b7fd6c2 100644 --- a/docs/usage-guide/fundamentals.md +++ b/docs/usage-guide/fundamentals.md @@ -5,7 +5,7 @@ This section provides detailed descriptions of all the ways `instagrapi` can be ## Public vs Private Requests -* `Public` (anonymous request via web api) methods have a suffix `_gql` (Instagram `GraphQL`) or `_a1` (example `https://www.instagram.com/adw0rd/?__a=1`) +* `Public` (anonymous request via web api) methods have a suffix `_gql` (Instagram `GraphQL`) or `_a1` (example `https://www.instagram.com/example/?__a=1`) * `Private` (authorized request via mobile api) methods have `_v1` suffix The first request to fetch media/user is `public` (anonymous), if instagram raise exception, then use `private` (authorized). @@ -33,7 +33,7 @@ The first request to fetch media/user is `public` (anonymous), if instagram rais * [`StoryMention`](story.md) - Mention users in Story (user, coordinates and dimensions) * [`StoryHashtag`](story.md) - Hashtag for story (as sticker) * [`StorySticker`](story.md) - Tag sticker to story (for example from giphy) - * [`StoryBuild`](story.md) - [StoryBuilder](https://github.com/adw0rd/instagrapi/blob/master/instagrapi/story.py) return path to photo/video and mention co-ordinates + * [`StoryBuild`](story.md) - [StoryBuilder](https://github.com/subzeroid/instagrapi/blob/master/instagrapi/story.py) return path to photo/video and mention co-ordinates * [`DirectThread`](direct.md) - Thread (topic) with messages in Direct Message * [`DirectMessage`](direct.md) - Message in Direct Message * [`Insight`](insight.md) - Insights for a post diff --git a/docs/usage-guide/handle_exception.md b/docs/usage-guide/handle_exception.md index 5b32df45..8cb96783 100644 --- a/docs/usage-guide/handle_exception.md +++ b/docs/usage-guide/handle_exception.md @@ -65,4 +65,4 @@ cl.login(USERNAME, PASSWORD) In this way, you can centrally handle errors and not repeat handlers throughout your code. -Full example [here](https://github.com/adw0rd/instagrapi/blob/master/examples/handle_exception.py) \ No newline at end of file +Full example [here](https://github.com/subzeroid/instagrapi/blob/master/examples/handle_exception.py) diff --git a/docs/usage-guide/hashtag.md b/docs/usage-guide/hashtag.md index 8e7fce9a..8e24fd54 100644 --- a/docs/usage-guide/hashtag.md +++ b/docs/usage-guide/hashtag.md @@ -128,7 +128,7 @@ Low level methods: | hashtag_medias_recent_v1(name: str, amount: int = 27) | List[Media] | Get recent medias for a hashtag by Private Mobile API | hashtag_medias_reels_v1(name: str, amount: int = 27) | List[Media] | Get recent clips (reels) for a hashtag by Private Mobile API -Example for [Request for loading every next time new posts from hashtag](https://github.com/adw0rd/instagrapi/issues/79): +Example for [Request for loading every next time new posts from hashtag](https://github.com/subzeroid/instagrapi/issues/79): ``` python >>> medias, cursor = cl.hashtag_medias_v1_chunk('test', max_amount=32, tab_key='recent') @@ -144,4 +144,4 @@ QVFDR0dzT3FJT0V4amFjMaQ3czlGVzRKV3FNWDJqaE1mWmltWU5VWGYtbnV6RVpoOUlsR3dCN05RRmpL 32 >>> cursor QVFEUXpfM0RtaDdmMExPQ0k0UWRlaHFJa2RVdVlaX01LTzhkNF9Dd1N2UlhtVy1vSTZvMERfYW5XN205OTBRNFBCSVJ2ZTVfTG5ZMXVmY0VJbUM5TU9URQ== -``` \ No newline at end of file +``` diff --git a/docs/usage-guide/interactions.md b/docs/usage-guide/interactions.md index 6e11f85f..ed16efa2 100644 --- a/docs/usage-guide/interactions.md +++ b/docs/usage-guide/interactions.md @@ -21,7 +21,7 @@ * [`StoryMention`](story.md) - Mention users in Story (user, coordinates and dimensions) * [`StoryHashtag`](story.md) - Hashtag for story (as sticker) * [`StorySticker`](story.md) - Tag sticker to story (for example from giphy) -* [`StoryBuild`](story.md) - [StoryBuilder](https://github.com/adw0rd/instagrapi/blob/master/instagrapi/story.py) return path to photo/video and mention co-ordinates +* [`StoryBuild`](story.md) - [StoryBuilder](https://github.com/subzeroid/instagrapi/blob/master/instagrapi/story.py) return path to photo/video and mention co-ordinates * [`DirectThread`](direct.md) - Thread (topic) with messages in Direct * [`DirectMessage`](direct.md) - Message in Direct * [`Insight`](insight.md) - Insights for a post @@ -32,7 +32,7 @@ `instagrapi` provides the following `Interactions` that can be used to control and get the information about your `Instagram` account: * Client(settings: dict = {}, proxy: str = ""): bool - Init `instagrapi` client - + ``` python cl.login("instagrapi", "42") # cl.login("instagrapi", "42", verification_code="123456") # with 2FA verification_code @@ -110,7 +110,7 @@ Store and manage uuids, device configuration, user agent, authorization data (ak | load\_settings(path: Path) | dict | Load session settings from file | dump\_settings(path: Path) | bool | Serialize and save session settings to file -In order for Instagram [to trust you more](https://github.com/adw0rd/instagrapi/discussions/220), you must always login from one device and one IP (or from a subnet): +In order for Instagram [to trust you more](https://github.com/subzeroid/instagrapi/discussions/220), you must always login from one device and one IP (or from a subnet): ```python cl = Client() diff --git a/docs/usage-guide/media.md b/docs/usage-guide/media.md index 5ec4e75e..2f7cf399 100644 --- a/docs/usage-guide/media.md +++ b/docs/usage-guide/media.md @@ -95,8 +95,8 @@ Low level methods: 'external_id': 181364832764479, 'external_id_source': 'facebook_places'}, 'user': {'pk': 1903424587, - 'username': 'adw0rd', - 'full_name': 'Mikhail Andreev', + 'username': 'example', + 'full_name': 'Example Example', 'profile_pic_url': HttpUrl('https://scontent-hel3-1.cdninstagram.com/v/t51.2885-19/s150x150/123884060_...&oe=5FD7600E')}, 'comment_count': 0, 'like_count': 48, @@ -122,8 +122,8 @@ Low level methods: >>> cl.media_oembed("https://www.instagram.com/p/B3mr1-OlWMG/").dict() {'version': '1.0', 'title': 'В гостях у ДК @delai_krasivo_kaifui', - 'author_name': 'adw0rd', - 'author_url': 'https://www.instagram.com/adw0rd', + 'author_name': 'example', + 'author_url': 'https://www.instagram.com/example', 'author_id': 1903424587, 'media_id': '2154602296692269830_1903424587', 'provider_name': 'Instagram', @@ -154,7 +154,7 @@ True 'thumbnail_url': None, 'location': None, 'user': {'pk': 1903424587, - 'username': 'adw0rd', + 'username': 'example', 'full_name': '', 'profile_pic_url': None, 'profile_pic_url_hd': None, @@ -240,9 +240,9 @@ PosixPath('/tmp/45588546_367538213983456_6830188946193737023_n.mp4') 1787135824035452364 >>> cl.album_download(1787135824035452364) -[PosixPath('/app/adw0rd_1787135361353462176.mp4'), - PosixPath('/app/adw0rd_1787135762219834098.mp4'), - PosixPath('/app/adw0rd_1787133803186894424.jpg')] +[PosixPath('/app/example_1787135361353462176.mp4'), + PosixPath('/app/example_1787135762219834098.mp4'), + PosixPath('/app/example_1787133803186894424.jpg')] ``` @@ -252,7 +252,7 @@ Upload medias to your feed. Common arguments: * `path` - Path to source file * `caption` - Text for you post -* `usertags` - List[Usertag] of mention users (see `Usertag` in [types.py](https://github.com/adw0rd/instagrapi/blob/master/instagrapi/types.py)) +* `usertags` - List[Usertag] of mention users (see `Usertag` in [types.py](https://github.com/subzeroid/instagrapi/blob/master/instagrapi/types.py)) * `location` - Location (e.g. `Location(name='Test', lat=42.0, lng=42.0)`) | Method | Return | Description @@ -269,8 +269,8 @@ In `extra_data`, you can pass additional media settings, for example: | Method | Type | Description | ----------------------------- | ------ | ------------------ -| custom_accessibility_caption | String | [Set alternative text](https://github.com/adw0rd/instagrapi/issues/351) `{"custom_accessibility_caption": "ALT TEXT HERE"}` -| like_and_view_counts_disabled | Int | [Disable like and view counts](https://github.com/adw0rd/instagrapi/issues/382) `{"like_and_view_counts_disabled": 1}` +| custom_accessibility_caption | String | [Set alternative text](https://github.com/subzeroid/instagrapi/issues/351) `{"custom_accessibility_caption": "ALT TEXT HERE"}` +| like_and_view_counts_disabled | Int | [Disable like and view counts](https://github.com/subzeroid/instagrapi/issues/382) `{"like_and_view_counts_disabled": 1}` | disable_comments | Int | Disable comments `{"disable_comments": 1}` | invite_coauthor_user_id | Int | Add a coauthor to the post `{"invite_coauthor_user_id": "USER ID OF COAUTHOR HERE"}`. You also need to add this user to `usertags` @@ -284,7 +284,7 @@ In `extra_data`, you can pass additional media settings, for example: >>> media = cl.photo_upload( "/app/image.jpg", - "Test caption for photo with #hashtags and mention users such @adw0rd", + "Test caption for photo with #hashtags and mention users such @example", extra_data={ "custom_accessibility_caption": "alt text example", "like_and_view_counts_disabled": 1, @@ -302,14 +302,14 @@ In `extra_data`, you can pass additional media settings, for example: 'thumbnail_url': HttpUrl('https://instagram.fhel5-1.fna.fbcdn.net/v/t51.2885-15/e35/185486538_463522984736407_6315244509641560230_n.jpg?se=8&tp=1&_nc_ht=instagram.fhel5-1.fna.fbcdn.net&_nc_cat=107&_nc_ohc=6tBMsh9HlmMAX9zI_jc&edm=ACqnv0EBAAAA&ccb=7-4&oh=2b46f1e9fbd2416eb7d08b398e0f639e&oe=60C30437&_nc_sid=9ec724&ig_cache_key=MjU3MzM0NzQyNzg3MzcyNjc2NA%3D%3D.2-ccb7-4', scheme='https', host='instagram.fhel5-1.fna.fbcdn.net', tld='net', host_type='domain', path='/v/t51.2885-15/e35/185486538_463522984736407_6315244509641560230_n.jpg', query='se=8&tp=1&_nc_ht=instagram.fhel5-1.fna.fbcdn.net&_nc_cat=107&_nc_ohc=6tBMsh9HlmMAX9zI_jc&edm=ACqnv0EBAAAA&ccb=7-4&oh=2b46f1e9fbd2416eb7d08b398e0f639e&oe=60C30437&_nc_sid=9ec724&ig_cache_key=MjU3MzM0NzQyNzg3MzcyNjc2NA%3D%3D.2-ccb7-4'), 'location': None, 'user': {'pk': 1903424587, - 'username': 'adw0rd', - 'full_name': 'Mikhail Andreev', + 'username': 'example', + 'full_name': 'Example Example', 'profile_pic_url': HttpUrl('https://instagram.fhel5-1.fna.fbcdn.net/v/t51.2885-19/s150x150/156689363_269505058076642_6448820957073669709_n.jpg?tp=1&_nc_ht=instagram.fhel5-1.fna.fbcdn.net&_nc_ohc=EtzrL0pAdg8AX-Xq8yS&edm=ACqnv0EBAAAA&ccb=7-4&oh=e2fd6a9d362f8587ea8123f23b248f1b&oe=60C2CB91&_nc_sid=9ec724', scheme='https', host='instagram.fhel5-1.fna.fbcdn.net', tld='net', host_type='domain', path='/v/t51.2885-19/s150x150/156689363_269505058076642_6448820957073669709_n.jpg', query='tp=1&_nc_ht=instagram.fhel5-1.fna.fbcdn.net&_nc_ohc=EtzrL0pAdg8AX-Xq8yS&edm=ACqnv0EBAAAA&ccb=7-4&oh=e2fd6a9d362f8587ea8123f23b248f1b&oe=60C2CB91&_nc_sid=9ec724'), 'stories': []}, 'comment_count': 0, 'like_count': 0, 'has_liked': None, - 'caption_text': 'Test caption for photo with #hashtags and mention users such @adw0rd', + 'caption_text': 'Test caption for photo with #hashtags and mention users such @example', 'usertags': [], 'video_url': None, 'view_count': 0, @@ -327,11 +327,11 @@ Now let's mention users (Usertag) and location: >>> cl = Client() >>> cl.login(USERNAME, PASSWORD) ->>> adw0rd = cl.user_info_by_username('adw0rd') +>>> example = cl.user_info_by_username('example') >>> media = cl.photo_upload( "/app/image.jpg", - "Test caption for photo with #hashtags and mention users such @adw0rd", - usertags=[Usertag(user=adw0rd, x=0.5, y=0.5)], + "Test caption for photo with #hashtags and mention users such @example", + usertags=[Usertag(user=example, x=0.5, y=0.5)], location=Location(name='Russia, Saint-Petersburg', lat=59.96, lng=30.29) ) @@ -351,17 +351,17 @@ Now let's mention users (Usertag) and location: 'external_id': 107617247320879, 'external_id_source': 'facebook_places'}, 'user': {'pk': 1903424587, - 'username': 'adw0rd', - 'full_name': 'Mikhail Andreev', + 'username': 'example', + 'full_name': 'Example Example', 'profile_pic_url': HttpUrl('https://instagram.fhel5-1.fna.fbcdn.net/v/t51.2885-19/s150x150/156689363_269505058076642_6448820957073669709_n.jpg?tp=1&_nc_ht=instagram.fhel5-1.fna.fbcdn.net&_nc_ohc=EtzrL0pAdg8AX-Xq8yS&edm=ACqnv0EBAAAA&ccb=7-4&oh=e2fd6a9d362f8587ea8123f23b248f1b&oe=60C2CB91&_nc_sid=9ec724', scheme='https', host='instagram.fhel5-1.fna.fbcdn.net', tld='net', host_type='domain', path='/v/t51.2885-19/s150x150/156689363_269505058076642_6448820957073669709_n.jpg', query='tp=1&_nc_ht=instagram.fhel5-1.fna.fbcdn.net&_nc_ohc=EtzrL0pAdg8AX-Xq8yS&edm=ACqnv0EBAAAA&ccb=7-4&oh=e2fd6a9d362f8587ea8123f23b248f1b&oe=60C2CB91&_nc_sid=9ec724'), 'stories': []}, 'comment_count': 0, 'like_count': 0, 'has_liked': None, - 'caption_text': 'Test caption for photo with #hashtags and mention users such @adw0rd', + 'caption_text': 'Test caption for photo with #hashtags and mention users such @example', 'usertags': [{'user': {'pk': 1903424587, - 'username': 'adw0rd', - 'full_name': 'Mikhail Andreev', + 'username': 'example', + 'full_name': 'Example Example', 'profile_pic_url': HttpUrl('https://instagram.fhel5-1.fna.fbcdn.net/v/t51.2885-19/s150x150/156689363_269505058076642_6448820957073669709_n.jpg?tp=1&_nc_ht=instagram.fhel5-1.fna.fbcdn.net&_nc_ohc=EtzrL0pAdg8AX-Xq8yS&edm=ACqnv0EBAAAA&ccb=7-4&oh=e2fd6a9d362f8587ea8123f23b248f1b&oe=60C2CB91&_nc_sid=9ec724', scheme='https', host='instagram.fhel5-1.fna.fbcdn.net', tld='net', host_type='domain', path='/v/t51.2885-19/s150x150/156689363_269505058076642_6448820957073669709_n.jpg', query='tp=1&_nc_ht=instagram.fhel5-1.fna.fbcdn.net&_nc_ohc=EtzrL0pAdg8AX-Xq8yS&edm=ACqnv0EBAAAA&ccb=7-4&oh=e2fd6a9d362f8587ea8123f23b248f1b&oe=60C2CB91&_nc_sid=9ec724'), 'stories': []}, 'x': 0.5, diff --git a/docs/usage-guide/story.md b/docs/usage-guide/story.md index 949830f8..ef11e8f2 100644 --- a/docs/usage-guide/story.md +++ b/docs/usage-guide/story.md @@ -16,7 +16,7 @@ Example: ``` python ->>> cl.story_download(cl.story_pk_from_url('https://www.instagram.com/stories/adw0rd/2581281926631793076/')) +>>> cl.story_download(cl.story_pk_from_url('https://www.instagram.com/stories/example/2581281926631793076/')) PosixPath('/app/189361307_229642088942817_9180243596650100310_n.mp4') >>> s = cl.story_info(2581281926631793076) @@ -55,7 +55,7 @@ In `extra_data`, you can pass additional story settings, for example: | Method | Type | Description | ----------------- | ------ | ------------------ -| audience | String | [Publish story for close friends](https://github.com/adw0rd/instagrapi/issues/1210) `{"audience": "besties"}` +| audience | String | [Publish story for close friends](https://github.com/subzeroid/instagrapi/issues/1210) `{"audience": "besties"}` Examples: @@ -69,14 +69,14 @@ cl.login(USERNAME, PASSWORD) media_pk = cl.media_pk_from_url('https://www.instagram.com/p/CGgDsi7JQdS/') media_path = cl.video_download(media_pk) -adw0rd = cl.user_info_by_username('adw0rd') +example = cl.user_info_by_username('example') hashtag = cl.hashtag_info('dhbastards') cl.video_upload_to_story( media_path, - "Credits @adw0rd", - mentions=[StoryMention(user=adw0rd, x=0.49892962, y=0.703125, width=0.8333333333333334, height=0.125)], - links=[StoryLink(webUri='https://github.com/adw0rd/instagrapi')], + "Credits @example", + mentions=[StoryMention(user=example, x=0.49892962, y=0.703125, width=0.8333333333333334, height=0.125)], + links=[StoryLink(webUri='https://github.com/subzeroid/instagrapi')], hashtags=[StoryHashtag(hashtag=hashtag, x=0.23, y=0.32, width=0.5, height=0.22)], medias=[StoryMedia(media_pk=media_pk, x=0.5, y=0.5, width=0.6, height=0.8)], ) @@ -100,27 +100,27 @@ from instagrapi.story import StoryBuilder media_pk = cl.media_pk_from_url('https://www.instagram.com/p/CGgDsi7JQdS/') media_path = cl.video_download(media_pk) -adw0rd = cl.user_info_by_username('adw0rd') +example = cl.user_info_by_username('example') buildout = StoryBuilder( media_path, - 'Credits @adw0rd', - [StoryMention(user=adw0rd)], + 'Credits @example', + [StoryMention(user=example)], Path('/path/to/background_720x1280.jpg') ).video(15) # seconds cl.video_upload_to_story( buildout.path, - "Credits @adw0rd", + "Credits @example", mentions=buildout.mentions, - links=[StoryLink(webUri='https://github.com/adw0rd/instagrapi')], + links=[StoryLink(webUri='https://github.com/subzeroid/instagrapi')], medias=[StoryMedia(media_pk=media_pk)] ) ``` Result: -![](https://raw.githubusercontent.com/adw0rd/instagrapi/master/examples/dhb.gif) +![](https://raw.githubusercontent.com/example/instagrapi/master/examples/dhb.gif) Photo upload: diff --git a/docs/usage-guide/user.md b/docs/usage-guide/user.md index 31cc71c6..c6e9cbcd 100644 --- a/docs/usage-guide/user.md +++ b/docs/usage-guide/user.md @@ -77,10 +77,10 @@ dict_keys([5563084402, 43848984510, 1498977320, ...]) ... } ->>> cl.user_info_by_username('adw0rd').dict() +>>> cl.user_info_by_username('example').dict() {'pk': 1903424587, - 'username': 'adw0rd', - 'full_name': 'Mikhail Andreev', + 'username': 'example', + 'full_name': 'Example Example', 'is_private': False, 'profile_pic_url': HttpUrl('https://scontent-hel3-1.cdninstagram.com/v/t51.2885-19/s150x150/123884060_803537687159702_2508263208740189974_n.jpg?...', scheme='https', host='scontent-hel3-1.cdninstagram.com', tld='com', host_type='domain', ...'), 'is_verified': False, @@ -88,9 +88,9 @@ dict_keys([5563084402, 43848984510, 1498977320, ...]) 'follower_count': 576, 'following_count': 538, 'biography': 'Engineer: Python, JavaScript, Erlang', - 'external_url': HttpUrl('https://adw0rd.com/', scheme='https', host='adw0rd.com', tld='com', host_type='domain', path='/'), + 'external_url': HttpUrl('https://example.org/', scheme='https', host='example.org', tld='com', host_type='domain', path='/'), 'is_business': False} - + ``` Example: We go around the list of our followers and unfollow from them: diff --git a/examples/next_proxy.py b/examples/next_proxy.py index 82ae7fe5..c886279c 100644 --- a/examples/next_proxy.py +++ b/examples/next_proxy.py @@ -1,7 +1,7 @@ """ An example when you need to change proxy -https://github.com/adw0rd/instagrapi/discussions/299 +https://github.com/subzeroid/instagrapi/discussions/299 """ import random diff --git a/instagrapi/mixins/hashtag.py b/instagrapi/mixins/hashtag.py index af2156c3..72a1d4cd 100644 --- a/instagrapi/mixins/hashtag.py +++ b/instagrapi/mixins/hashtag.py @@ -112,7 +112,7 @@ def hashtag_info(self, name: str) -> Hashtag: hashtag = self.hashtag_info_a1(name) except Exception: # Users do not understand the output of such information and create bug reports - # such this - https://github.com/adw0rd/instagrapi/issues/364 + # such this - https://github.com/subzeroid/instagrapi/issues/364 # if not isinstance(e, ClientError): # self.logger.exception(e) hashtag = self.hashtag_info_v1(name) diff --git a/instagrapi/mixins/location.py b/instagrapi/mixins/location.py index baff6c79..5e2e001b 100644 --- a/instagrapi/mixins/location.py +++ b/instagrapi/mixins/location.py @@ -178,7 +178,7 @@ def location_info(self, location_pk: int) -> Location: location = self.location_info_a1(location_pk) except Exception: # Users do not understand the output of such information and create bug reports - # such this - https://github.com/adw0rd/instagrapi/issues/364 + # such this - https://github.com/subzeroid/instagrapi/issues/364 # if not isinstance(e, ClientError): # self.logger.exception(e) location = self.location_info_v1(location_pk) @@ -421,7 +421,7 @@ def location_medias_top( return self.location_medias_top_a1(location_pk, amount, sleep) except Exception: # Users do not understand the output of such information and create bug reports - # such this - https://github.com/adw0rd/instagrapi/issues/364 + # such this - https://github.com/subzeroid/instagrapi/issues/364 # if not isinstance(e, ClientError): # self.logger.exception(e) return self.location_medias_top_v1(location_pk, amount) @@ -494,7 +494,7 @@ def location_medias_recent( return self.location_medias_recent_a1(location_pk, amount, sleep) except Exception: # Users do not understand the output of such information and create bug reports - # such this - https://github.com/adw0rd/instagrapi/issues/364 + # such this - https://github.com/subzeroid/instagrapi/issues/364 # if not isinstance(e, ClientError): # self.logger.exception(e) return self.location_medias_recent_v1(location_pk, amount) diff --git a/instagrapi/mixins/story.py b/instagrapi/mixins/story.py index 07fa42bf..65daf199 100644 --- a/instagrapi/mixins/story.py +++ b/instagrapi/mixins/story.py @@ -296,7 +296,7 @@ def story_download_by_url( fname = urlparse(url).path.rsplit("/", 1)[1].strip() assert fname, ( """The URL must contain the path to the file (mp4 or jpg).\n""" - """Read the documentation https://adw0rd.github.io/instagrapi/usage-guide/story.html""" + """Read the documentation https://subzeroid.github.io/instagrapi/usage-guide/story.html""" ) filename = "%s.%s" % (filename, fname.rsplit(".", 1)[1]) if filename else fname path = Path(folder) / filename diff --git a/instagrapi/mixins/user.py b/instagrapi/mixins/user.py index 5962622e..5792d7d2 100644 --- a/instagrapi/mixins/user.py +++ b/instagrapi/mixins/user.py @@ -44,7 +44,7 @@ def user_id_from_username(self, username: str) -> str: Example ------- - 'adw0rd' -> 1903424587 + 'example' -> 1903424587 """ username = str(username).lower() return str(self.user_info_by_username(username).pk) @@ -98,7 +98,7 @@ def username_from_user_id_gql(self, user_id: str) -> str: Example ------- - 1903424587 -> 'adw0rd' + 1903424587 -> 'example' """ return self.user_short_gql(user_id).username @@ -118,7 +118,7 @@ def username_from_user_id(self, user_id: str) -> str: Example ------- - 1903424587 -> 'adw0rd' + 1903424587 -> 'example' """ user_id = str(user_id) try: diff --git a/mkdocs.yml b/mkdocs.yml index 92efb1d4..a3ccfe29 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,7 +1,7 @@ site_name: instagrapi Documentation -repo_url: https://github.com/adw0rd/instagrapi/ -site_url: https://adw0rd.github.io/instagrapi/ -repo_name: adw0rd/instagrapi +repo_url: https://github.com/subzeroid/instagrapi/ +site_url: https://subzeroid.github.io/instagrapi/ +repo_name: subzeroid/instagrapi edit_uri: edit/main/docs/ docs_dir: docs nav: diff --git a/setup.py b/setup.py index e7104d11..c1b6b613 100644 --- a/setup.py +++ b/setup.py @@ -32,10 +32,10 @@ setup( name="instagrapi", version="1.19.8", - author="Mikhail Andreev", + author="Example Example", author_email="x11org@gmail.com", license="MIT", - url="https://github.com/adw0rd/instagrapi", + url="https://github.com/subzeroid/instagrapi", install_requires=requirements, keywords=[ "instagram private api", diff --git a/tests.py b/tests.py index 2f03dd9a..840141fe 100644 --- a/tests.py +++ b/tests.py @@ -8,7 +8,12 @@ from pathlib import Path from instagrapi import Client -from instagrapi.exceptions import BadCredentials, DirectThreadNotFound, ProxyAddressIsBlocked, BadPassword +from instagrapi.exceptions import ( + BadCredentials, + DirectThreadNotFound, + ProxyAddressIsBlocked, + BadPassword, +) from instagrapi.story import StoryBuilder from instagrapi.types import ( Account, @@ -108,7 +113,8 @@ def test_login(self): self.cl.login(ACCOUNT_USERNAME, ACCOUNT_PASSWORD) except (ProxyAddressIsBlocked, BadPassword) as e: self.assertEqual( - str(e), "The password you entered is incorrect. Please try again. If you are sure that the password is correct, then change your IP address, because it is added to the blacklist of the Instagram Server" + str(e), + "The password you entered is incorrect. Please try again. If you are sure that the password is correct, then change your IP address, because it is added to the blacklist of the Instagram Server", ) try: @@ -118,9 +124,11 @@ def test_login(self): self.assertEqual(str(e), "Both username and password must be provided.") except ProxyAddressIsBlocked as e: self.assertEqual( - str(e), "Instagram has blocked your IP address, use a quality proxy provider (not free, not shared)" + str(e), + "Instagram has blocked your IP address, use a quality proxy provider (not free, not shared)", ) + class ClientPrivateTestCase(BaseClientMixin, unittest.TestCase): cl = None @@ -194,8 +202,8 @@ def test_media_info_gql(self): self.assertDict(m.dict(), media) user = { "pk": 1903424587, - "username": "adw0rd", - "full_name": "Mikhail Andreev", + "username": "example", + "full_name": "Example Example", "profile_pic_url": "https://...", } self.assertDict(m.user.dict(), user) @@ -339,7 +347,7 @@ def test_set_device(self): settings = self.cl.get_settings() self.assertDictEqual(device, settings["device_settings"]) self.assertEqual(user_agent, settings["user_agent"]) - self.cl.user_info_by_username_v1("adw0rd") + self.cl.user_info_by_username_v1("example") request_user_agent = self.cl.last_response.request.headers.get("User-Agent") self.assertEqual(user_agent, request_user_agent) @@ -369,10 +377,10 @@ def test_set_device_agent(self): class ClientUserTestCase(ClientPrivateTestCase): def test_username_from_user_id(self): - self.assertEqual(self.cl.username_from_user_id(1903424587), "adw0rd") + self.assertEqual(self.cl.username_from_user_id(1903424587), "example") def test_user_medias(self): - user_id = self.cl.user_id_from_username("adw0rd") + user_id = self.cl.user_id_from_username("example") medias = self.cl.user_medias(user_id) self.assertGreater(len(medias), 100) media = medias[0] @@ -381,7 +389,7 @@ def test_user_medias(self): self.assertTrue(hasattr(media, field)) def test_usertag_medias(self): - user_id = self.cl.user_id_from_username("adw0rd") + user_id = self.cl.user_id_from_username("example") medias = self.cl.usertag_medias(user_id) self.assertGreater(len(medias), 50) media = medias[0] @@ -410,7 +418,7 @@ def test_user_following(self): self.assertEqual(following[user_id].username, "asphalt_kings_lb") def test_user_following_amount(self): - user_id = self.cl.user_id_from_username("adw0rd") + user_id = self.cl.user_id_from_username("example") following = self.cl.user_following(user_id, amount=10) self.assertTrue(len(following) == 10) self.assertIsInstance(list(following.values())[0], UserShort) @@ -425,18 +433,18 @@ def test_user_follow_unfollow(self): self.assertNotIn(user_id, following) def test_user_info(self): - user_id = self.cl.user_id_from_username("adw0rd") + user_id = self.cl.user_id_from_username("example") user = self.cl.user_info(user_id) self.assertIsInstance(user, User) for key, value in { "biography": "Engineer: Python, JavaScript, Erlang...", - "external_url": "https://adw0rd.com/", - "full_name": "Mikhail Andreev", + "external_url": "https://example.org/", + "full_name": "Example Example", "pk": 1903424587, "is_private": False, "is_verified": False, "profile_pic_url": "https://...", - "username": "adw0rd", + "username": "example", }.items(): if isinstance(value, str) and "..." in value: self.assertTrue(value.replace("...", "") in getattr(user, key)) @@ -444,10 +452,10 @@ def test_user_info(self): self.assertEqual(value, getattr(user, key)) def test_user_info_by_username(self): - user = self.cl.user_info_by_username("adw0rd") + user = self.cl.user_info_by_username("example") self.assertIsInstance(user, User) self.assertEqual(user.pk, 1903424587) - self.assertEqual(user.full_name, "Mikhail Andreev") + self.assertEqual(user.full_name, "Example Example") self.assertFalse(user.is_private) def test_age_restricted_user_info_by_username(self): @@ -556,8 +564,8 @@ def test_media_user(self): self.assertIsInstance(user, UserShort) for key, val in { "pk": 1903424587, - "username": "adw0rd", - "full_name": "Mikhail Andreev", + "username": "example", + "full_name": "Example Example", "is_private": False, }.items(): self.assertEqual(getattr(user, key), val) @@ -568,8 +576,8 @@ def test_media_oembed(self): self.assertIsInstance(media_oembed, MediaOembed) for key, val in { "title": "В гостях у ДК @delai_krasivo_kaifui", - "author_name": "adw0rd", - "author_url": "https://www.instagram.com/adw0rd", + "author_name": "example", + "author_url": "https://www.instagram.com/example", "author_id": 1903424587, "media_id": "2154602296692269830_1903424587", "width": 658, @@ -759,7 +767,7 @@ def test_extract_media_photo(self): self.assertTrue(getattr(media, key).startswith(val)) else: self.assertEqual(getattr(media, key), val) - for key, val in {"pk": 1903424587, "username": "adw0rd"}.items(): + for key, val in {"pk": 1903424587, "username": "example"}.items(): self.assertEqual(getattr(media.user, key), val) def test_extract_media_video(self): @@ -783,7 +791,7 @@ def test_extract_media_video(self): self.assertTrue(getattr(media, key).startswith(val)) else: self.assertEqual(getattr(media, key), val) - for key, val in {"pk": 1903424587, "username": "adw0rd"}.items(): + for key, val in {"pk": 1903424587, "username": "example"}.items(): self.assertEqual(getattr(media.user, key), val) def test_extract_media_album(self): @@ -806,7 +814,7 @@ def test_extract_media_album(self): "product_type": "", }.items(): self.assertEqual(getattr(media, key), val) - for key, val in {"pk": 1903424587, "username": "adw0rd"}.items(): + for key, val in {"pk": 1903424587, "username": "example"}.items(): self.assertEqual(getattr(media.user, key), val) for key, val in { "video_url": "https://", @@ -854,7 +862,7 @@ def test_extract_media_igtv(self): self.assertTrue(getattr(media, key).startswith(val)) else: self.assertEqual(getattr(media, key), val) - for key, val in {"pk": 1903424587, "username": "adw0rd"}.items(): + for key, val in {"pk": 1903424587, "username": "example"}.items(): self.assertEqual(getattr(media.user, key), val) @@ -941,8 +949,8 @@ def test_album_upload(self): paths = self.cl.album_download(media_pk) [self.assertIsInstance(path, Path) for path in paths] try: - adw0rd = self.cl.user_info_by_username("adw0rd") - usertag = Usertag(user=adw0rd, x=0.5, y=0.5) + example = self.cl.user_info_by_username("example") + usertag = Usertag(user=example, x=0.5, y=0.5) location = self.get_location() media = self.cl.album_upload( paths, "Test caption for album", usertags=[usertag], location=location @@ -1065,14 +1073,16 @@ def test_direct_thread(self): # self.assertTrue(thread.is_seen(self.cl.user_id)) message = messages[0] self.assertIsInstance(message, DirectMessage) - adw0rd = self.cl.user_id_from_username("adw0rd") - ping = self.cl.direct_send("Ping", user_ids=[adw0rd]) + example = self.cl.user_id_from_username("example") + ping = self.cl.direct_send("Ping", user_ids=[example]) self.assertIsInstance(ping, DirectMessage) pong = self.cl.direct_answer(ping.thread_id, "Pong") self.assertIsInstance(pong, DirectMessage) self.assertEqual(ping.thread_id, pong.thread_id) # send direct photo - photo = self.cl.direct_send_photo(path="examples/kanada.jpg", user_ids=[adw0rd]) + photo = self.cl.direct_send_photo( + path="examples/kanada.jpg", user_ids=[example] + ) self.assertIsInstance(photo, DirectMessage) self.assertEqual(photo.thread_id, pong.thread_id) # send seen @@ -1086,16 +1096,16 @@ def test_direct_thread(self): self.assertTrue(self.cl.direct_thread_unmute_video_call(thread.id)) def test_direct_send_photo(self): - adw0rd = self.cl.user_id_from_username("adw0rd") - dm = self.cl.direct_send_photo(path="examples/kanada.jpg", user_ids=[adw0rd]) + example = self.cl.user_id_from_username("example") + dm = self.cl.direct_send_photo(path="examples/kanada.jpg", user_ids=[example]) self.assertIsInstance(dm, DirectMessage) def test_direct_send_video(self): - adw0rd = self.cl.user_id_from_username("adw0rd") + example = self.cl.user_id_from_username("example") path = self.cl.video_download( self.cl.media_pk_from_url("https://www.instagram.com/p/B3rFQPblq40/") ) - dm = self.cl.direct_send_video(path=path, user_ids=[adw0rd]) + dm = self.cl.direct_send_video(path=path, user_ids=[example]) self.assertIsInstance(dm, DirectMessage) def test_direct_thread_by_participants(self): @@ -1124,10 +1134,10 @@ def test_account_change_picture(self): # current one = self.cl.user_info(self.cl.user_id) self.assertIsInstance(one, User) - adw0rd = self.cl.user_info_by_username("adw0rd") + example = self.cl.user_info_by_username("example") # change two = self.cl.account_change_picture( - self.cl.photo_download_by_url(adw0rd.profile_pic_url) + self.cl.photo_download_by_url(example.profile_pic_url) ) self.assertIsInstance(two, UserShort) # return back @@ -1318,11 +1328,11 @@ def test_upload_photo_story(self): path = self.cl.photo_download(media_pk) self.assertIsInstance(path, Path) caption = "Test photo caption" - adw0rd = self.cl.user_info_by_username("adw0rd") - self.assertIsInstance(adw0rd, User) - mentions = [StoryMention(user=adw0rd)] + example = self.cl.user_info_by_username("example") + self.assertIsInstance(example, User) + mentions = [StoryMention(user=example)] medias = [StoryMedia(media_pk=media_pk, x=0.5, y=0.5, width=0.6, height=0.8)] - links = [StoryLink(webUri="https://adw0rd.com/")] + links = [StoryLink(webUri="https://example.org/")] # hashtags = [StoryHashtag(hashtag=self.cl.hashtag_info('dhbastards'))] # locations = [ # StoryLocation( @@ -1373,11 +1383,11 @@ def test_upload_video_story(self): path = self.cl.video_download(media_pk) self.assertIsInstance(path, Path) caption = "Test video caption" - adw0rd = self.cl.user_info_by_username("adw0rd") - self.assertIsInstance(adw0rd, User) - mentions = [StoryMention(user=adw0rd)] + example = self.cl.user_info_by_username("example") + self.assertIsInstance(example, User) + mentions = [StoryMention(user=example)] medias = [StoryMedia(media_pk=media_pk, x=0.5, y=0.5, width=0.6, height=0.8)] - links = [StoryLink(webUri="https://adw0rd.com/")] + links = [StoryLink(webUri="https://example.org/")] # hashtags = [StoryHashtag(hashtag=self.cl.hashtag_info('dhbastards'))] # locations = [ # StoryLocation( @@ -1422,7 +1432,7 @@ def test_user_stories(self): self.assertIsInstance(story, Story) for field in REQUIRED_STORY_FIELDS: self.assertTrue(hasattr(story, field)) - stories = self.cl.user_stories(self.cl.user_id_from_username("adw0rd")) + stories = self.cl.user_stories(self.cl.user_id_from_username("example")) self.assertIsInstance(stories, list) def test_extract_user_stories(self):