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

Media is Liked by Logged in Account boolean #466

Closed Chuckler22 closed 2 years ago

Chuckler22 commented 2 years ago

Is your feature request related to a problem? Please describe. When viewing the properties of a media item, it would be very useful to know if I have already liked the post. Obviously we already have media_like and media_unlike methods, but it would be useful to know if I have already liked this post or not.

Describe the solution you'd like New method "media_isliked" that returns TRUE if the media has been liked by the logged in user. If the logged in user has not liked the post, media_isliked returns FALSE.

Describe alternatives you've considered Whether the authenticated user has liked a media could also be returned in media_info ... { "media_isliked" : "true" or "false" }

Additional context NA

adw0rd commented 2 years ago

This has already been implemented when calling media_info https://github.com/adw0rd/instagrapi/blob/master/instagrapi/types.py#L110

>>> cl.media_info_v1(cl.media_pk_from_code('CW1HG_IATJh')).has_liked
True

>>> cl.media_info_v1(cl.media_pk_from_code('CW1EZT_Ahrh')).has_liked
False