subzeroid / instagrapi

🔥 The fastest and powerful Python library for Instagram Private API 2024
https://hikerapi.com/p/bkXQlaVe
MIT License
4.38k stars 685 forks source link

How can I get the link of a shared post in direct? #1137

Open Pooya500 opened 1 year ago

Pooya500 commented 1 year ago

Hello,

I am trying to use the Instagrapi library to retrieve the link of a shared post in direct messages. I have searched the documentation and tried a few different approaches, but I haven't been able to find a way to access the link of the shared post.

Can anyone provide guidance on how to retrieve the link of a shared post in direct using Instagrapi? Specifically, I would like to know if there is a method or attribute I can use to access the link of the post, and if there are any specific steps I need to take to retrieve the link.

Any help would be greatly appreciated. Thank you in advance!

abundis-rmn2 commented 1 year ago

whats your response when you try to get the direct message?

Pooya500 commented 1 year ago

When I receive a text message :

DirectMessage(id='30928464275545514639664041540190208', user_id=[3855970297](tel:3855970297), thread_id=340282366841710300949128307338723689965, timestamp=datetime.datetime(2023, 2, 17, 12, 3, 27, 959338, tzinfo=datetime.timezone.utc), item_type='text', is_sent_by_viewer=False, is_shh_mode=False, reactions=None, text='سلام', reply=None, link=None, animated_media=None, media=None, visual_media=None, media_share=None, reel_share=None, story_share=None, felix_share=None, clip=None, placeholder=None)

When I receive a shared post :

DirectMessage(id='30928465794714136322186273351532544', user_id=[3855970297](tel:3855970297), thread_id=340282366841710300949128307338723689965, timestamp=datetime.datetime(2023, 2, 17, 12, 4, 50, 313634, tzinfo=datetime.timezone.utc), item_type='xma_clip', is_sent_by_viewer=False, is_shh_mode=False, reactions=None, text=None, reply=None, link=None, animated_media=None, media=None, visual_media=None, media_share=None, reel_share=None, story_share=None, felix_share=None, clip=None, placeholder=None)

turkeryi commented 1 year ago
item_type='xma_story_share'
item_type='xma_media_share'

other media related fields are None. any suggestions?

SaeidB commented 1 year ago

Hello,

I am trying to use the Instagrapi library to retrieve the link of a shared post in direct messages. I have searched the documentation and tried a few different approaches, but I haven't been able to find a way to access the link of the shared post.

Can anyone provide guidance on how to retrieve the link of a shared post in direct using Instagrapi? Specifically, I would like to know if there is a method or attribute I can use to access the link of the post, and if there are any specific steps I need to take to retrieve the link.

Any help would be greatly appreciated. Thank you in advance!

yes u can get url of the shared medias , but i dont remember the method in instagrapi , search direct in instagrapi and u can find the method to do that , similar to :

direct_v2/threads/thread_id/get_items/

MahdiAbdi commented 1 year ago

I have this problem too, and yet I haven't been able to find any answers.

SaeidB commented 1 year ago

I have this problem too, and yet I haven't been able to find any answers.

cl.direct_thread

MahdiAbdi commented 1 year ago

I have this problem too, and yet I haven't been able to find any answers.

cl.direct_thread

@SaeidB

the problem is with DirectMessage. when the item type is "xma_media_share" or "xma_story_share" there is no media_id or media_pk and the rest of the fields related to the shared media are empty. so there's no way to access the original shared media info.

MahdiAbdi commented 1 year ago

@adw0rd

adw0rd commented 1 year ago

@MahdiAbdi submit your PR with a fix to the problem you are talking about

ssriramagiri commented 1 year ago

Fairly new here and struggling to get Proxyman running successfully. Any chance someone can help with adding the same attributes for 'xma_profile'? Similar issue as above but unsure what the answer from instagram for that call. Happy to submit a PR if someone can help me with that response from IG on that alone 😀 Thanks!