SaeidB
SaeidB
> I hope, you understand my points. Hardcoding values like this and not relying on existing functions is in general a bad practice (maintainability, generalizability, ...). > > I got...
> Here, you can see the current setup: > > https://github.com/subzeroid/instagrapi/blob/b83a00b6d5c23029d9ab22b573ef26ebc79ef262/instagrapi/mixins/public.py#L209 > > . You can possibly also create a new function there (if needed) and then rely on that...
check the instagrapi gql requests , the headers are same everytime , it uses its own user agent , not logged-in client user agent (mobile), not base_headers , if you...
> My main argument stands. Hard coding this like you did is not good practice. Also, there is no error handling for the request. > > The already existing functions...
the current code which i wrote in my pr will work , however if you mean adding error handling , you can do it by this : `return extract_user_gql(json.loads(cl.public_request(f'https://www.instagram.com/api/v1/users/web_profile_info/?username={username}', headers=headers))['data']['user'])`...
> Not sure, but probably we don't want to update the internal headers with the ones that are only used for that request?\n\nAdditionally, probably some more refactoring is sensible (like...
> Try to have a look at my referenced line again. It shows that if headers are passed to `public_request`, the headers will then get updated (which is not wanted)....
check the changes i made now , i added update_headers=False and i think everything is good now and enough for this step
> Just add one thing, hardcoding user-agent can lead to auto-detection of the bot on the Instagram-side so I would recommend actually making it exactly the same globally for every...
> @SaeidB > > ``` > Traceback (most recent call last): > File "/Users/mknappe/Projects/inst/instagrapi/test.py", line 2, in > from instagrapi import Client > File "/Users/mknappe/Projects/inst/instagrapi/instagrapi/__init__.py", line 31, in > from...