dilame / instagram-private-api

NodeJS Instagram private API SDK. Written in TypeScript.
MIT License
5.99k stars 1.14k forks source link

ReelsMediaFeedResponseItem missing optional Stickers #1228

Open fantapop opened 4 years ago

fantapop commented 4 years ago

Bug Report

Form

Requirements

Description

story_hashtags is an optional object that can come back with the ReelsMediaFeedResponseItem however it is missing in the type definition. I need to extend the type locally in order to use this field in my code.

Code

    const reelsFeed = ig.feed.reelsMedia({
        // working with reels media feed (stories feed)
        userIds: [targetUser.pk], // you can specify multiple user id's, "pk" param is user id
    });
    const items = await reelsFeed.items(); // getting reels, see "account-followers.feed.example.ts" if you want to know how to work with feeds
   console.log('story items: ', JSON.stringify(items, null, 4));

Output

The following fragment was included in the output.

        "story_hashtags": [
            {
                "x": "0.47555556911892305",
                "y": "0.8750726640074281",
                "z": 0,
                "width": "0.6318749999999991",
                "height": "0.06014531275606701",
                "rotation": 0,
                "is_pinned": 0,
                "is_hidden": 0,
                "is_sticker": 0,
                "is_fb_sticker": 0,
                "hashtag": {
                    "name": "christest234hi",
                    "id": "17847298544203242"
                }
            }
        ],
Nerixyz commented 4 years ago

Most of the stickers are missing

fantapop commented 4 years ago

I have some more samples, I'll add them here in case they're helpful:

user mentions:

    "reel_mentions": [
        {
            "x": "0.247139756944444",
            "y": "0.348207031249999",
            "z": 0,
            "width": "0.35205729166666605",
            "height": 0.0373828125,
            "rotation": 0,
            "is_pinned": 0,
            "is_hidden": 0,
            "display_type": "mention_username",
            "is_sticker": 0,
            "is_fb_sticker": 0,
            "user": {
                "pk": 123456,
                "username": "username",
                "full_name": "Full Name",
                "is_private": true,
                "profile_pic_url": "cdn_url",
                "is_verified": false
            }
        }
    ],

music:

      "story_music_stickers": [
            {
                "x": 0,
                "y": 0,
                "z": 1,
                "width": 0,
                "height": 0,
                "rotation": 0,
                "attribution": "Sticker by Taylor Swift",
                "is_pinned": 0,
                "is_hidden": 0,
                "display_type": "music_hidden",
                "is_sticker": 1,
                "is_fb_sticker": 0,
                "music_asset_info": {
                    "audio_cluster_id": null,
                    "id": "1938719862817065",
                    "title": "Style",
                    "subtitle": "",
                    "display_artist": "Taylor Swift",
                    "cover_artwork_uri": "https://cdn.fbsbx.com/v/t65.14500-21/cp0/e15/q65/p526x296/36971762_251353852310410_216837741835452416_n.jpg?_nc_cat=111&_nc_sid=cbead8&_nc_ohc=E2CKDlcGjJwAX_lbzyn&_nc_ht=cdn.fbsbx.com&_nc_tp=3&oh=e3039bc016aeced3e5b3b6af71338a39&oe=5F1B7031",
                    "cover_artwork_thumbnail_uri": "https://cdn.fbsbx.com/v/t65.14500-21/cp0/e15/q65/s168x128/36971762_251353852310410_216837741835452416_n.jpg?_nc_cat=111&_nc_sid=cbead8&_nc_ohc=E2CKDlcGjJwAX_lbzyn&_nc_ht=cdn.fbsbx.com&tp=9&oh=e836931cb700717c2ac4c9a40bd68fdd&oe=5F1BF023",
                    "progressive_download_url": "https://video-mia3-2.xx.fbcdn.net/v/t39.12897-2/38774826_253808008775282_1447939999260475392_n.m4a?_nc_cat=109&_nc_sid=02c1ff&_nc_ohc=L2LGSPNbhfsAX-DQgE9&_nc_ht=video-mia3-2.xx&oh=27e05e6871b90762343b3fc1c3a10f20&oe=5F3E3041",
                    "highlight_start_times_in_ms": [
                        60000,
                        75500,
                        90500
                    ],
                    "is_explicit": false,
                    "dash_manifest": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--Generated with https://github.com/google/shaka-packager version v1.6.0-release-->\n<MPD xmlns=\"urn:mpeg:dash:schema:mpd:2011\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:cenc=\"urn:mpeg:cenc:2013\" 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=\"PT231.043S\">\n  <Period id=\"0\">\n    <AdaptationSet id=\"0\" contentType=\"audio\" subsegmentAlignment=\"true\">\n      <Representation id=\"0\" bandwidth=\"130006\" codecs=\"mp4a.40.2\" mimeType=\"audio/mp4\" audioSamplingRate=\"48000\">\n        <AudioChannelConfiguration schemeIdUri=\"urn:mpeg:dash:23003:3:audio_channel_configuration:2011\" value=\"2\"/>\n        <BaseURL>https://video-mia3-1.xx.fbcdn.net/v/t39.12897-2/43945848_637268513341126_1946180412032155648_n.m4a?_nc_cat=100&amp;_nc_sid=02c1ff&amp;_nc_ohc=XpIx7jelU_oAX-BwOIf&amp;_nc_ht=video-mia3-1.xx&amp;oh=56dc95f6620bf361400fac1a32f4559f&amp;oe=5F3F0840</BaseURL>\n        <SegmentBase indexRange=\"741-2164\" timescale=\"48000\">\n          <Initialization range=\"0-740\"/>\n        </SegmentBase>\n      </Representation>\n    </AdaptationSet>\n  </Period>\n</MPD>\n",
                    "has_lyrics": true,
                    "audio_asset_id": "1938719862817065",
                    "duration_in_ms": 231000,
                    "dark_message": null,
                    "allows_saving": false,
                    "ig_artist": {
                        "pk": 11830955,
                        "username": "taylorswift",
                        "full_name": "Taylor Swift",
                        "is_private": false,
                        "profile_pic_url": "https://scontent-mia3-2.cdninstagram.com/v/t51.2885-19/s150x150/110606554_274256377193351_7760278100826446941_n.jpg?_nc_ht=scontent-mia3-2.cdninstagram.com&_nc_ohc=-2SvpkUE4PwAX_S4opc&oh=a88dd2718583da0dedf7f2ab3dc910e3&oe=5F44B956",
                        "profile_pic_id": "2359595082791715570_11830955",
                        "is_verified": true
                    },
                    "placeholder_profile_pic_url": "https://scontent-mia3-2.cdninstagram.com/v/t51.12442-15/43985629_311105916145351_58064759811405776_n.jpg.png?_nc_ht=scontent-mia3-2.cdninstagram.com&_nc_ohc=nxmNinVh2EAAX87Pc6j&oh=71f0fc05df62047b0e41998f987ce9e0&oe=5F44EEC5",
                    "should_mute_audio": false,
                    "should_mute_audio_reason": "This song is currently unavailable.",
                    "is_bookmarked": false,
                    "overlap_duration_in_ms": 15000,
                    "audio_asset_start_time_in_ms": 60000
                }
            }
        ],
        "story_music_lyric_stickers": [
            {
                "x": "0.488313802083333",
                "y": "0.36876678466796803",
                "z": 0,
                "width": "0.676627604166666",
                "height": "0.39453356933593703",
                "rotation": 0,
                "is_pinned": 0,
                "is_hidden": 0,
                "is_sticker": 1,
                "is_fb_sticker": 0
            }
        ],

various effects stickers:

        "creative_config": {
            "camera_facing": "front",
            "effect_ids": [
                256947631755483
            ],
            "face_effect_id": 256947631755483,
            "capture_type": "superzoom",
            "persisted_effect_metadata_json": "{}",
            "should_render_try_it_on": false,
            "failure_reason": null,
            "effect_preview": {
                "name": "superzoom_angry",
                "id": "256947631755483",
                "gatekeeper": "ig_camera_superzoom_v3",
                "gatelogic": null,
                "attribution_user_id": "0",
                "attribution_user": null,
                "thumbnail_image": {
                    "uri": "https://scontent-mia3-2.xx.fbcdn.net/v/t39.10260-6/39501782_1370915489709453_4841993890099625984_n.png?_nc_cat=1&_nc_sid=df6b83&_nc_ohc=d_jtA2AqNdQAX-8ADTK&_nc_ad=z-m&_nc_cid=0&_nc_ht=scontent-mia3-2.xx&oh=8d3ccb1a0ef542cf2ef034a8a2a8b962&oe=5F3FB1DA"
                },
                "effect_actions": [
                    "REMOVE",
                    "PROFILE",
                    "REPORT",
                    "LICENSING"
                ],
                "effect_action_sheet": {
                    "primary_actions": [
                        "TRY_IT"
                    ],
                    "secondary_actions": [
                        "EXPLORE_EFFECTS",
                        "REPORT"
                    ]
                },
                "save_status": "NOT_SAVED",
                "device_position": null
            },
            "effect_configs": [
                {
                    "name": "superzoom_angry",
                    "id": "256947631755483",
                    "failure_reason": null,
                    "failure_code": null,
                    "gatekeeper": "ig_camera_superzoom_v3",
                    "attribution_user_id": "0",
                    "attribution_user": null,
                    "gatelogic": null,
                    "save_status": "NOT_SAVED",
                    "effect_actions": [
                        "REMOVE",
                        "PROFILE",
                        "REPORT",
                        "LICENSING"
                    ],
                    "is_spot_recognition_effect": false,
                    "is_spot_effect": false,
                    "thumbnail_image": {
                        "uri": "https://scontent-mia3-2.xx.fbcdn.net/v/t39.10260-6/39501782_1370915489709453_4841993890099625984_n.png?_nc_cat=1&_nc_sid=df6b83&_nc_ohc=d_jtA2AqNdQAX-8ADTK&_nc_ad=z-m&_nc_cid=0&_nc_ht=scontent-mia3-2.xx&oh=8d3ccb1a0ef542cf2ef034a8a2a8b962&oe=5F3FB1DA"
                    },
                    "effect_action_sheet": {
                        "primary_actions": [
                            "TRY_IT"
                        ],
                        "secondary_actions": [
                            "EXPLORE_EFFECTS",
                            "REPORT"
                        ]
                    },
                    "device_position": null
                }
            ]
        },
  "creative_config": {
    "camera_facing": "front",
    "effect_ids": [
      "2464413990547511"
    ],
    "face_effect_id": "2464413990547511",
    "capture_type": "normal",
    "should_render_try_it_on": false,
    "failure_reason": null,
    "effect_preview": {
      "name": "Light Leak IV",
      "id": "2464413990547511",
      "gatekeeper": "ig_fe_h2_2019_creative_holdout",
      "gatelogic": null,
      "attribution_user_id": "0",
      "attribution_user": null,
      "thumbnail_image": {
        "uri": "https://scontent-mia3-2.xx.fbcdn.net/v/t39.10260-6/76971841_419489278716478_3899324632498438144_n.png?_nc_cat=1&_nc_sid=df6b83&_nc_ohc=xRsU0HoVNsgAX91-Cq5&_nc_ad=z-m&_nc_cid=0&_nc_ht=scontent-mia3-2.xx&oh=276613dde92c681aaf64430de257579e&oe=5F3491DE"
      },
      "effect_actions": [
        "REMOVE",
        "PROFILE",
        "REPORT",
        "LICENSING"
      ],
      "effect_action_sheet": {
        "primary_actions": [
          "TRY_IT",
          "SAVE_TO_CAMERA",
          "SENDTO"
        ],
        "secondary_actions": [
          "EXPLORE_EFFECTS",
          "REPORT"
        ]
      },
      "save_status": "NOT_SAVED",
      "device_position": null
    },
    "effect_configs": [
      {
        "name": "Light Leak IV",
        "id": "2464413990547511",
        "failure_reason": null,
        "failure_code": null,
        "gatekeeper": "ig_fe_h2_2019_creative_holdout",
        "attribution_user_id": "0",
        "attribution_user": null,
        "gatelogic": null,
        "save_status": "NOT_SAVED",
        "effect_actions": [
          "REMOVE",
          "PROFILE",
          "REPORT",
          "LICENSING"
        ],
        "is_spot_recognition_effect": false,
        "is_spot_effect": false,
        "thumbnail_image": {
          "uri": "https://scontent-mia3-2.xx.fbcdn.net/v/t39.10260-6/76971841_419489278716478_3899324632498438144_n.png?_nc_cat=1&_nc_sid=df6b83&_nc_ohc=xRsU0HoVNsgAX91-Cq5&_nc_ad=z-m&_nc_cid=0&_nc_ht=scontent-mia3-2.xx&oh=276613dde92c681aaf64430de257579e&oe=5F3491DE"
        },
        "effect_action_sheet": {
          "primary_actions": [
            "TRY_IT",
            "SAVE_TO_CAMERA",
            "SENDTO"
          ],
          "secondary_actions": [
            "EXPLORE_EFFECTS",
            "REPORT"
          ]
        },
        "device_position": null
      }
    ]
  },

locations:

  "story_locations": [
    {
      "x": 0.5,
      "y": 0.5,
      "z": 2,
      "width": "0.88211209439528",
      "height": "0.065688053097345",
      "rotation": 0,
      "is_pinned": 0,
      "is_hidden": 0,
      "is_sticker": 1,
      "is_fb_sticker": 0,
      "location": {
        "pk": 215981475,
        "name": "Ponte Vedra Beach, Florida",
        "address": "",
        "city": "",
        "short_name": "Ponte Vedra Beach",
        "lng": -80.1234,
        "lat": 30.1234,
        "external_source": "facebook_places",
        "facebook_places_id": 112691428745843
      }
    }
  ],
chiragshah1312 commented 4 years ago

@fantapop Can you help me with how to fetch just reels and not stories? I'm using your code, but this is giving me stories. I want just reels videos

const reelsFeed = this.ig_client.feed.reelsMedia({userIds: [user_id],}); const items = await reelsFeed.items();