-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Try HikerAPI SaaS with a free trial https://hikerapi.com/p/KhMxYMSn
Describe the bug
An incorrect GraphQL query was sent
To Reproduce
from aiograpi import Client
target_pk = "2423232424" # Random PK For Example
cli = Client()
await cli.login(USERNAME, PASSWORD)
response = cli.user_info(user_id=target_pk)Traceback
A print line was added to mixin/public.py above line 240 to print the body_json variable
Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/palestine.pixel/?__a=1&__d=dis) >>>
{'errors': [{'message': 'execution error', 'code': 1675002, 'summary': 'Incorrect Query', 'description': 'The query provided was invalid.', 'extensions': {}, 'severity': 'CRITICAL'}], 'status': 'ok'}
'data'
Traceback (most recent call last):
File "/home/hopper/codes/instagram_scraper/env/lib/python3.10/site-packages/aiograpi/mixins/user.py", line 327, in user_info
user = await self.user_info_gql(user_id)
File "/home/hopper/codes/instagram_scraper/env/lib/python3.10/site-packages/aiograpi/mixins/user.py", line 242, in user_info_gql
await self.username_from_user_id_gql(user_id)
File "/home/hopper/codes/instagram_scraper/env/lib/python3.10/site-packages/aiograpi/mixins/user.py", line 104, in username_from_user_id_gql
return (await self.user_short_gql(user_id)).username
File "/home/hopper/codes/instagram_scraper/env/lib/python3.10/site-packages/aiograpi/mixins/user.py", line 78, in user_short_gql
data = await self.public_graphql_request(
File "/home/hopper/codes/instagram_scraper/env/lib/python3.10/site-packages/aiograpi/mixins/public.py", line 241, in public_graphql_request
return body_json["data"]
KeyError: 'data'
{'errors': [{'message': 'execution error', 'code': 1675002, 'summary': 'Incorrect Query', 'description': 'The query provided was invalid.', 'extensions': {}, 'severity': 'CRITICAL'}], 'status': 'ok'}
'data'
Traceback (most recent call last):
File "/home/hopper/codes/instagram_scraper/env/lib/python3.10/site-packages/aiograpi/mixins/user.py", line 327, in user_info
user = await self.user_info_gql(user_id)
File "/home/hopper/codes/instagram_scraper/env/lib/python3.10/site-packages/aiograpi/mixins/user.py", line 242, in user_info_gql
await self.username_from_user_id_gql(user_id)
File "/home/hopper/codes/instagram_scraper/env/lib/python3.10/site-packages/aiograpi/mixins/user.py", line 104, in username_from_user_id_gql
return (await self.user_short_gql(user_id)).username
File "/home/hopper/codes/instagram_scraper/env/lib/python3.10/site-packages/aiograpi/mixins/user.py", line 78, in user_short_gql
data = await self.public_graphql_request(
File "/home/hopper/codes/instagram_scraper/env/lib/python3.10/site-packages/aiograpi/mixins/public.py", line 241, in public_graphql_request
return body_json["data"]
KeyError: 'data'
pk='6030533849' username='palestine.pixel' full_name='Palestine Pixel' is_private=False profile_pic_url=HttpUrl('https://scontent-yyz1-1.cdninstagram.com/v/t51.2885-19/405764278_915323583267252_457215099787979714_n.jpg?stp=dst-jpg_e0_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby40MDAuYzIifQ&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2QHL3c2nuwxVB3osSQk3_bd0Popv7HMyt-438mSGPOgU678R8C-c9K7QfxuisaQyjIo&_nc_ohc=BsCHysXItlsQ7kNvwF2s2x9&_nc_gid=pChic1WBRvwUbCFuve-5Yg&edm=AEF8tYYBAAAA&ccb=7-5&ig_cache_key=GLZ4Lxi0AQlhe0ADAMKrzvi1WlgGbkULAAAB-ccb7-5&oh=00_AfWtuysecS_FwOlOZ5S7xFhllL8A7GiM1HZOU8f00BuUkQ&oe=68BAA319&_nc_sid=1e20d2') profile_pic_url_hd=HttpUrl('https://scontent-yyz1-1.cdninstagram.com/v/t51.2885-19/405764278_915323583267252_457215099787979714_n.jpg?stp=dst-jpg_s320x320_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby40MDAuYzIifQ&_nc_ht=scontent-yyz1-1.cdninstagram.com&_nc_cat=1&_nc_oc=Q6cZ2QHL3c2nuwxVB3osSQk3_bd0Popv7HMyt-438mSGPOgU678R8C-c9K7QfxuisaQyjIo&_nc_ohc=BsCHysXItlsQ7kNvwF2s2x9&_nc_gid=pChic1WBRvwUbCFuve-5Yg&edm=AEF8tYYBAAAA&ccb=7-5&ig_cache_key=GLZ4Lxi0AQlhe0ADAMKrzvi1WlgGbkULAAAB13-ccb7-5&oh=00_AfVPWFgMBv2eWnZymWxn6ZKfGXfkdEN1tdRFIVOkFI5-dg&oe=68BAA319&_nc_sid=1e20d2') is_verified=True media_count=31901 follower_count=1404225 following_count=714 biography='π΅πΈ Daily news from Palestine: You can stand with our team via Patreon:' bio_links=[BioLink(link_id='17964215966744037', url='https://www.patreon.com/Palestinepixel', lynx_url='https://l.instagram.com/?u=https%3A%2F%2Fwww.patreon.com%2FPalestinepixel%3Ffbclid%3DPAZXh0bgNhZW0CMTEAAaetp728Cjpi3X0gTywBPRHxEq8MQY_pnmLaeFu10gGAza1_K0XXSMaitNKNtQ_aem_93F4DTxBZT5Ibn2x6PvnuQ&e=AT1SmaxJ6hIYH9VORNCCLwBhJNLWwwx3CERmJHFEl0ORBe4-unq5cYuZzruDcPsX1RXDyDoOFtsyBp2NV0l6OlFw8osfBcVtXaYt1Fg', link_type='external', title='Support us via Patreon', is_pinned=False, open_external_url_with_in_app_browser=True)] external_url='https://www.patreon.com/Palestinepixel' account_type=3 is_business=False public_email='' contact_phone_number='' public_phone_country_code='' public_phone_number='' business_contact_method='UNKNOWN' business_category_name=None category_name=None category='Media/news company' address_street='' city_id=None city_name='' latitude=0.0 longitude=0.0 zip='' instagram_location_id='' interop_messaging_user_fbid='107689433955774'Expected behavior
Simple, it should've just returned proper JSON data but instead the library sends im assuming a query which is now improper, possibly due to changes on Instagram's side
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Windows 11 WSL2 - Ubuntu 22.04 LTS
- Python version 3.10.12
- aiograpi version Git Commit 115efa8
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working