instagrapi icon indicating copy to clipboard operation
instagrapi copied to clipboard

[BUG] comment_count, like_count, and play_count is invalid

Open tixlag opened this issue 1 year ago • 0 comments

Try Instagrapi SaaS with a free trial https://hikerapi.com/p/5GBWznd3

Describe the bug I get information about Reels: cl.media_info_v1(cl.media_pk_from_url("https://www.instagram.com/p/C_BM2yAN4Rm"))

The following response is received:

{ "pk": 3441088131388376166, "id": "3441088131388376166_7579664505", "code": "C_BM2yAN4Rm", "taken_at": "2024-08-23T16:16:51Z", "media_type": 2, "image_versions2": { "candidates": [ { "width": 360, "height": 639, "url": "https://scontent-fra3-1.cdninstagram.com/v/t51.29350-15/456512376_1271381594021499_656046502228006793_n.jpg?stp=dst-jpg_e15_p360x360&_nc_cb=9b69d9bc-c83dec71&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xMTcweDIwNzYuc2RyLmYyOTM1MC5kZWZhdWx0X2NvdmVyX2ZyYW1lIn0&_nc_ht=scontent-fra3-1.cdninstagram.com&_nc_cat=103&_nc_ohc=RKmILS2ICysQ7kNvgGn1EnP&edm=ALQROFkBAAAA&ccb=7-5&ig_cache_key=MzQ0MTA4ODEzMTM4ODM3NjE2Ng%3D%3D.3-ccb7-5-_nc_cb9b69d9bc-c83dec71&oh=00_AYCHORELg9rB3jLNr-mJDGbgIFWu7ZUUSDD547QGbKf6ng&oe=66D75269&_nc_sid=fc8dfb", "scans_profile": "e15" } ], "additional_candidates": { "igtv_first_frame": { "width": 360, "height": 639, "url": "https://scontent-fra5-1.cdninstagram.com/v/t51.2885-15/456442963_1494397707850634_5662148839537838731_n.jpg?stp=dst-jpg_e15_p360x360&_nc_cb=9b69d9bc-c83dec71&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi42NDB4MTEzNi5zZHIuZjcxODc4LmFkZGl0aW9uYWxfY292ZXJfZnJhbWUifQ&_nc_ht=scontent-fra5-1.cdninstagram.com&_nc_cat=102&_nc_ohc=_rfhUY197yoQ7kNvgHuFwP7&edm=ALQROFkBAAAA&ccb=7-5&oh=00_AYAzzJ7wZrwyvgBOlBEka_KtFO4RcyAKt99FEXFkfTUyGg&oe=66D73858&_nc_sid=fc8dfb", "scans_profile": "e15" }, "first_frame": { "width": 360, "height": 639, "url": "https://scontent-fra5-1.cdninstagram.com/v/t51.2885-15/456442963_1494397707850634_5662148839537838731_n.jpg?stp=dst-jpg_e15_p360x360&_nc_cb=9b69d9bc-c83dec71&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi42NDB4MTEzNi5zZHIuZjcxODc4LmFkZGl0aW9uYWxfY292ZXJfZnJhbWUifQ&_nc_ht=scontent-fra5-1.cdninstagram.com&_nc_cat=102&_nc_ohc=_rfhUY197yoQ7kNvgHuFwP7&edm=ALQROFkBAAAA&ccb=7-5&oh=00_AYAzzJ7wZrwyvgBOlBEka_KtFO4RcyAKt99FEXFkfTUyGg&oe=66D73858&_nc_sid=fc8dfb", "scans_profile": "e15" }, "smart_frame": null }, "scrubber_spritesheet_info_candidates": { "default": { "video_length": 13.333, "thumbnail_width": 100, "thumbnail_height": 178, "thumbnail_duration": 0.1269809523809524, "sprite_urls": [ "https://scontent-fra5-1.cdninstagram.com/v/t51.2885-15/456584924_852380229866870_2779706211287173260_n.jpg?_nc_ht=scontent-fra5-1.cdninstagram.com&_nc_cat=102&_nc_ohc=ttqi_yTk2ScQ7kNvgGmh4Ol&_nc_gid=94131b27d2ef42b29c0c56c84596de75&edm=ALQROFkBAAAA&ccb=7-5&oh=00_AYBjZGS6D_zYi1zbKb3RvI5qHqRRviDmbcdgO0p5NMlYBw&oe=66D74845&_nc_sid=fc8dfb" ], "thumbnails_per_row": 15, "total_thumbnail_num_per_sprite": 105, "max_thumbnails_per_sprite": 105, "sprite_width": 1500, "sprite_height": 1246, "rendered_width": 96, "file_size_kb": 264 } } }, "product_type": "clips", "thumbnail_url": "https://scontent-fra3-1.cdninstagram.com/v/t51.29350-15/456512376_1271381594021499_656046502228006793_n.jpg?stp=dst-jpg_e15_p360x360&_nc_cb=9b69d9bc-c83dec71&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi4xMTcweDIwNzYuc2RyLmYyOTM1MC5kZWZhdWx0X2NvdmVyX2ZyYW1lIn0&_nc_ht=scontent-fra3-1.cdninstagram.com&_nc_cat=103&_nc_ohc=RKmILS2ICysQ7kNvgGn1EnP&edm=ALQROFkBAAAA&ccb=7-5&ig_cache_key=MzQ0MTA4ODEzMTM4ODM3NjE2Ng%3D%3D.3-ccb7-5-_nc_cb9b69d9bc-c83dec71&oh=00_AYCHORELg9rB3jLNr-mJDGbgIFWu7ZUUSDD547QGbKf6ng&oe=66D75269&_nc_sid=fc8dfb", "location": null, "user": { "pk": "7579664505", "username": "waistline_shop", "full_name": "Waistline", "profile_pic_url": "https://scontent-fra5-2.cdninstagram.com/v/t51.2885-19/452898421_862676592585343_2219423535227101034_n.jpg?stp=dst-jpg_e0_s150x150&_nc_ht=scontent-fra5-2.cdninstagram.com&_nc_cat=107&_nc_ohc=xJmNzhh0w-sQ7kNvgExYasG&edm=ALQROFkBAAAA&ccb=7-5&oh=00_AYDhvInMoNIIgjO9k7EgI51uJIbEoQC9yB0dizzhc-NWUA&oe=66D7567B&_nc_sid=fc8dfb", "profile_pic_url_hd": null, "is_private": false }, "comment_count": 3, "comments_disabled": false, "commenting_disabled_for_viewer": false, "like_count": 3, "play_count": 15252, "has_liked": false, "caption_text": "Трюк, который точно подействует 🤫\n\nИ правильная базовая футболка от Waistline — это деталь, которая способна повлиять на твою уверенность. \n\nАртикул на WB: 175905777", "accessibility_caption": null, "usertags": [], "sponsor_tags": [], "video_url": "https://scontent.cdninstagram.com/o1/v/t16/f2/m69/An_ag-3MfbtsaA-BZD2xTnhJNrHaQRloy6_AP1cj6hYePG432LZPcdEyj4uUT7I5Nww1quISiJDQVkmftjDfKk_7.mp4?efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuMTA4MC5kYXNoX2Jhc2VsaW5lXzEwODBwX3YxIn0&_nc_ht=scontent.cdninstagram.com&_nc_cat=104&strext=1&vs=b551c3c91cf70c78&_nc_vs=HBksFQIYOnBhc3N0aHJvdWdoX2V2ZXJzdG9yZS9HQjN4TFFkREZIRExrWWdGQUtXdExnV25pV3ctYnBSMUFBQUYVAALIAQAVAhg6cGFzc3Rocm91Z2hfZXZlcnN0b3JlL0dLSzRQQnVCUzlOZVJQY0VBSE5SVi1JSFZFcHJicV9FQUFBRhUCAsgBACgAGAAbAogHdXNlX29pbAExEnByb2dyZXNzaXZlX3JlY2lwZQExFQAAJoKjz9TJmKIEFQIoAkMzLBdAKqp%2B%2Bdsi0RgWZGFzaF9iYXNlbGluZV8xMDgwcF92MREAdf4HAA%3D%3D&ccb=9-4&oh=00_AYAFWIDAXTqZyYFLCpqJY_LkIJj77q-GyFtYeeyJ5eXz6g&oe=66D358CD&_nc_sid=1d576d", "view_count": 0, "video_duration": 13.333, "title": "", "resources": [], "clips_metadata": { "breaking_content_info": null, "breaking_creator_info": null, "clips_creation_entry_point": "clips", "featured_label": null, "is_public_chat_welcome_video": false, "is_shared_to_fb": true, "professional_clips_upsell_type": 0, "reels_on_the_rise_info": null, "show_tips": null, "achievements_info": { "num_earned_achievements": null, "show_achievements": false }, "additional_audio_info": { "additional_audio_username": null, "audio_reattribution_info": { "should_allow_restore": false } }, "asset_recommendation_info": null, "audio_ranking_info": { "best_audio_cluster_id": "534703055670234" }, "audio_type": "original_sounds", "branded_content_tag_info": { "can_add_tag": false }, "challenge_info": null, "content_appreciation_info": { "enabled": false, "entry_point_container": null }, "contextual_highlight_info": null, "cutout_sticker_info": [], "disable_use_in_clips_client_cache": false, "external_media_info": null, "is_fan_club_promo_video": false, "mashup_info": { "mashups_allowed": true, "is_reuse_allowed": true, "can_toggle_mashups_allowed": false, "has_been_mashed_up": false, "is_light_weight_check": false, "is_light_weight_reuse_allowed_check": false, "formatted_mashups_count": null, "original_media": null, "privacy_filtered_mashups_media_count": null, "non_privacy_filtered_mashups_media_count": null, "mashup_type": null, "is_creator_requesting_mashup": false, "has_nonmimicable_additional_audio": false, "is_pivot_page_available": false }, "merchandising_pill_info": null, "music_canonical_id": "18452861677051938", "music_info": null, "nux_info": null, "original_sound_info": { "allow_creator_to_rename": true, "audio_asset_id": 1192260532058807, "can_remix_be_shared_to_fb": true, "can_remix_be_shared_to_fb_expansion": false, "dash_manifest": "\n\n<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" minBufferTime="PT2S" type="static" mediaPresentationDuration="PT13.303583145141602S">\n <Period id="0">\n <AdaptationSet id="0" contentType="audio" subsegmentAlignment="true">\n <Representation id="0" bandwidth="81266" codecs="mp4a.40.5" mimeType="audio/mp4" audioSamplingRate="44100">\n <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>\n <BaseURL>https://scontent-fra3-1.cdninstagram.com/v/t39.12897-6/456609420_1264293081605446_6921870834933034115_n.m4a?_nc_cat=105&ccb=1-7&_nc_sid=c2de2f&_nc_ohc=4LTgFMGYyjwQ7kNvgHD3FGJ&_nc_ad=z-m&nc_cid=0&nc_ht=scontent-fra3-1.cdninstagram.com&oh=00_AYAzhfHO5zooapAsM-Mw7ym53-hjEzo5hqPPR0scLjIpIg&oe=66D758FB</BaseURL>\n <SegmentBase indexRange="817-932" timescale="44100">\n <Initialization range="0-816"/>\n </SegmentBase>\n </Representation>\n </AdaptationSet>\n </Period>\n</MPD>\n", "duration_in_ms": 13303, "formatted_clips_media_count": null, "hide_remixing": false, "ig_artist": { "pk": 7579664505, "pk_id": "7579664505", "id": "7579664505", "full_name": "Waistline", "is_private": false, "strong_id": "7579664505", "username": "waistline_shop", "is_verified": false, "profile_pic_id": "3420590202983359928_7579664505", "profile_pic_url": "https://scontent-fra5-2.cdninstagram.com/v/t51.2885-19/452898421_862676592585343_2219423535227101034_n.jpg?stp=dst-jpg_e0_s150x150&_nc_ht=scontent-fra5-2.cdninstagram.com&_nc_cat=107&_nc_ohc=xJmNzhh0w-sQ7kNvgExYasG&edm=ALQROFkBAAAA&ccb=7-5&oh=00_AYDhvInMoNIIgjO9k7EgI51uJIbEoQC9yB0dizzhc-NWUA&oe=66D7567B&_nc_sid=fc8dfb" }, "is_audio_automatically_attributed": false, "is_eligible_for_audio_effects": true, "is_explicit": false, "is_original_audio_download_eligible": true, "is_reuse_disabled": false, "is_xpost_from_fb": false, "music_canonical_id": null, "oa_owner_is_music_artist": false, "original_audio_subtype": "default", "original_audio_title": "Original audio", "original_media_id": 3441088131388376166, "progressive_download_url": "https://scontent-fra3-1.cdninstagram.com/v/t39.12897-6/456559174_342775485596685_1881915306560257309_n.m4a?_nc_cat=105&ccb=1-7&_nc_sid=c2de2f&_nc_ohc=9Emy6n0EoFYQ7kNvgHV3iK5&_nc_ad=z-m&_nc_cid=0&_nc_ht=scontent-fra3-1.cdninstagram.com&oh=00_AYC3kXToUn-0qTraATEs2whgHwCzrR31a2c_rWxczf3cXQ&oe=66D748CD", "should_mute_audio": false, "time_created": 1724429814, "trend_rank": null, "previous_trend_rank": null, "audio_filter_infos": [], "audio_parts": [], "audio_parts_by_filter": [], "consumption_info": { "display_media_id": null, "is_bookmarked": false, "is_trending_in_clips": false, "should_mute_audio_reason": "", "should_mute_audio_reason_type": null }, "xpost_fb_creator_info": null }, "originality_info": null, "reusable_text_attribute_string": null, "reusable_text_info": null, "shopping_info": null, "show_achievements": false, "template_info": null, "viewer_interaction_settings": null } }

The problem is that like_count is an invalid number. At the time of the request, there are more than 150 pieces, but only 3 come via the api (like comment_count, this is the correct number)

To Reproduce media_info = cl.media_info_v1(cl.media_pk_from_url(url))

Expected behavior The API returns the correct comment_count, like_count, and play_count metrics for Reels

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 11
  • Python version 3.12.2
  • instagrapi version 2.12.2

Additional context If you use cl.insights_media(), then Reels gets all metrics as NoneType(

P.S. Thank you for your work! Really high-quality work!

tixlag avatar Aug 30 '24 10:08 tixlag