-
Notifications
You must be signed in to change notification settings - Fork 693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Location Search #100
base: master
Are you sure you want to change the base?
Changes from all commits
f5fa1b7
7277ed9
0381337
8504856
5ab2508
df025a1
6adf68e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from instagrapi import Client | ||
|
||
cl = Client() | ||
cl.login("YOUR_LOGIN", "YOUR_PASSWORD") | ||
|
||
cl.photo_upload("example.jpg"," 😀 😃 😄 😁 😆 😅 😂 🤣 ", True) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,6 +156,30 @@ def extract_location(data): | |
"""Extract location info""" | ||
if not data: | ||
return None | ||
data["pk"] = data.get("id", data.get("pk")) | ||
data["external_id"] = data.get("external_id", data.get("facebook_places_id")) | ||
data["external_id_source"] = data.get( | ||
"external_id_source", data.get("external_source") | ||
) | ||
|
||
# address_json = data.get("address_json", "{}") | ||
# if isinstance(address_json, str): | ||
# address_json = json.loads(address_json) | ||
# data['address_json'] = address_json | ||
return Location(**data) | ||
|
||
|
||
|
||
def extract_locationV2(data): | ||
"""Extract location info""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. extract_locationV2 - broken naming in the project (use extract_location_v2) |
||
if not data: | ||
return None | ||
data=data["place"]["location"] | ||
data["pk"] = data.get("id", data.get("pk")) | ||
try: | ||
data=data["place"]["location"] | ||
except: | ||
pass | ||
data["pk"] = data.get("id", data.get("pk", None)) | ||
data["external_id"] = data.get("external_id", data.get("facebook_places_id")) | ||
data["external_id_source"] = data.get( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,7 +234,7 @@ def top_search(self, query): | |
"rank_token": 0.7763938004511706, | ||
"include_reel": "true", | ||
} | ||
response = self.public_request(url, params=params, return_json=True) | ||
response = self.private_request(url, params=params) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error using private requests in a public module, this makes no sense (You use private_request in public.py module) |
||
return response | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why need storyUpload in photo_upload? Use photo_upload_to_story for uploading photo to story