subzeroid / instagrapi

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

How to get user reels included in user_medias reponse? #1146

Closed skords closed 1 year ago

skords commented 1 year ago

Hello

Sometimes a user uploads a reel but does not add it to their main feed. user_medias_paginated_v1 only returns the media added to the feed and not in the reels section.

For example:

This user: https://www.instagram.com/saniamistryy/ has not added this reel to their main feed: https://www.instagram.com/reel/CopWVIjqLnq/

I noticed that /clips/user/ returns the reels for the user but is there a way to get the reels included with user_medias_paginated_v1 ? response by passing some parameter?

adw0rd commented 1 year ago

https://github.com/adw0rd/instagrapi/blob/master/instagrapi/mixins/timeline.py

skords commented 1 year ago

https://github.com/adw0rd/instagrapi/blob/master/instagrapi/mixins/timeline.py

I am sorry I might be confused. I think this is for getting MY reels feed. I want to get clips/reels posted by other user by username/user_id

adw0rd commented 1 year ago

@skords ah, now I understand you, I'll see what can be done a little later

mces89 commented 1 year ago

looking forward for this method too

mces89 commented 1 year ago

@skords do you find any way or api so that it can return reels posted by other user by username/user_id?

adw0rd commented 1 year ago

@mces89 added in instagrapi 1.17.0

>>> clips = cl.user_clips_v1(25025320, amount=2)
>>> clips[0].dict()

{'pk': '3052048407587698594',
 'id': '3052048407587698594_25025320',
 'code': 'CpbDdszj7ei',
 'taken_at': datetime.datetime(2023, 3, 5, 21, 50, 4, tzinfo=datetime.timezone.utc),
 'media_type': 2,
 'product_type': 'clips',
 'thumbnail_url': HttpUrl('https://scontent-den4-1.cdninstagram.com/v/t51.2885-15/333966975_152901010970043_8971338145148712917_n.jpg?stp=dst-jpg_e15_p150x150&_nc_ht=scontent-den4-1.cdninstagram.com&_nc_cat=1&_nc_ohc=rRuJ7u4YrqEAX-UEMFq&edm=ACHbZRIBAAAA&ccb=7-5&ig_cache_key=MzA1MjA0ODQwNzU4NzY5ODU5NA%3D%3D.2-ccb7-5&oh=00_AfC_tNEWVjJLM5RQYUiQJFHQZSmvnDtAcpzs42DRSYt1pQ&oe=6409C451&_nc_sid=4a9e64', scheme='https', host='scontent-den4-1.cdninstagram.com', tld='com', host_type='domain', port='443', path='/v/t51.2885-15/333966975_152901010970043_8971338145148712917_n.jpg', query='stp=dst-jpg_e15_p150x150&_nc_ht=scontent-den4-1.cdninstagram.com&_nc_cat=1&_nc_ohc=rRuJ7u4YrqEAX-UEMFq&edm=ACHbZRIBAAAA&ccb=7-5&ig_cache_key=MzA1MjA0ODQwNzU4NzY5ODU5NA%3D%3D.2-ccb7-5&oh=00_AfC_tNEWVjJLM5RQYUiQJFHQZSmvnDtAcpzs42DRSYt1pQ&oe=6409C451&_nc_sid=4a9e64'),
 'location': {'pk': 213011753,
  'name': 'Sydney, Australia',
  'phone': '',
  'website': '',
  'category': '',
  'hours': {},
  'address': '',
  'city': '',
  'zip': None,
  'lng': 151.20797,
  'lat': -33.86751,
  'external_id': 110884905606108,
  'external_id_source': 'facebook_places'},
....
}