Skip to content

Commit

Permalink
Updated query_hash's and public_a1_request
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodnorwell committed Nov 29, 2023
1 parent 2f67cd4 commit c49daa5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion instagrapi/mixins/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ def _send_public_request(
self.last_response_ts = time.time()

def public_a1_request(self, endpoint, data=None, params=None, headers=None):
url = self.PUBLIC_API_URL + endpoint # (jarrodnorwell) fixed KeyError: 'data'
url = (self.PUBLIC_API_URL + str(endpoint)).replace(
".com//", ".com/"
) # (jarrodnorwell) fixed KeyError: 'data', fixed // error
params = params or {}
params.update({"__a": 1, "__d": "dis"})

Expand Down
5 changes: 2 additions & 3 deletions instagrapi/mixins/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ def search_users(self, query: str, count: int = 50) -> List[UserShort]:
return self.search_users_v1(query, count)

def search_followers_v1(self, user_id: str, query: str) -> List[UserShort]:

"""
Search users by followers (Private Mobile API)
Expand Down Expand Up @@ -507,7 +506,7 @@ def user_following_gql(self, user_id: str, amount: int = 0) -> List[UserShort]:
if end_cursor:
variables["after"] = end_cursor
data = self.public_graphql_request(
variables, query_hash="e7e2f4da4b02303f74f0841279e52d76"
variables, query_hash="58712303d941c6855d4e888c5f0cd22f"
)
if not data["user"] and not users:
raise UserNotFound(user_id=user_id, **data)
Expand Down Expand Up @@ -662,7 +661,7 @@ def user_followers_gql_chunk(
if end_cursor:
variables["after"] = end_cursor
data = self.public_graphql_request(
variables, query_hash="5aefa9893005572d237da5068082d8d5"
variables, query_hash="37479f2b8209594dde7facb0d904896a"
)
if not data["user"] and not users:
raise UserNotFound(user_id=user_id, **data)
Expand Down

0 comments on commit c49daa5

Please sign in to comment.