HOAIAN2 / Instagram-Downloader

Chrome Extension, download photos, videos from Instagram post, tv, reels, stories
MIT License
155 stars 21 forks source link

Why does it work when videos or images open in model and not on home screen ? #11

Closed funcbind closed 4 months ago

funcbind commented 5 months ago
HOAIAN2 commented 5 months ago

It possible to work without open the modal but it require a lot of work ( I tried it before). They save the post id on Home Screen on an object with key carouselParentId and pass it to a media component to render them out.

{
  "autoplay": true,
  "post": {
    "accessibilityCaption": null,
    "carouselParentId": "3374987543549461167",
    "dashInfo": "{is_dash_eligible: true, number_of_qualities: undef…}",
    "dimensions": "{height: 836, width: 836}",
    "displayResources": "[]",
    "id": "3374986631674203254",
    "inventorySource": "explore_story",
    "isVideo": false,
    "mediaOverlayInfo": "{banner: {…}, bloks_data: undefined, buttons: Array…}",
    "mediaPreview": "ACoqtwwqJNw4+XBx0/8A1+9SSKNy5zjnJ9hz6fh/9akgX5eeMk57ewHP51WuFABjBYkqWyTnhcn+fH41SWmpLl71o7GabiRy7L90n8h2rUSPZFknr8wP4Dj+fSqqiBIuQw3rkn/PT0x+VWLAPMp3E4Y/KvYBQB+p/lSWty22rWLKcEJ14yT6H09aoSRXG44PGTjr61Zt9zMzZyqnHvwf6e31qZs5PKde/wD+uqtfQSn3KV4BaIoyGkznIzgr23Dv7Hr+FRTXDTDavynHOD7dPp7VRvLgzSFumTx9MYFSQTqItuMscgk/oc9c+nIA96m4rLctBitv5RxliR/L/IqJQ9ugwWHuMimREs4x2zyOucVPMOR5m4Lj1HP5n+h5pFEP2thEUXIJwSc9ck7v6e5qVYVYA7HORnOf/rVmvhWYDlc8Hr79eKmW62gDngAdf/rU7iSIriMxHaehwR9DSwAAEn1H6Anj68Cr2sgCQY/u/wDsxqhD3pAW...",
    "owner": "{id: \"48019301529\"}",
    "sensitivityFrictionInfo": null,
    "sharingFrictionInfo": "{bloksAppUrl: null, shouldHaveSharingFriction: fals…}",
    "src": "https://scontent.cdninstagram.com/v/t51.29350-15/445478304_1115633246181144_6374404756157988745_n.jpg?stp=dst-jpg_e15&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi43MjB4NzIwLnNkci5mMjkzNTAifQ&_nc_ht=scontent.cdninstagram.com&_nc_cat=100&_nc_ohc=XI0A8U_MYF0Q7kNvgHRk4Ij&edm=APs17CUBAAAA&ccb=7-5&ig_cache_key=MzM3NDk4NjYzMTY3NDIwMzI1NA%3D%3D.2-ccb7-5&oh=00_AYDyIurbE-CLE44ANZl0SSBcyyq_8RMXT56td4V6Pr53Jw&oe=6658618A&_nc_sid=10d13b",
    "trackingToken": null,
    "videoResources": "[{…}, {…}, {…}]",
    "videoUrl": "https://scontent.cdninstagram.com/o1/v/t16/f2/m69/An_X_kfyeJ1WVWy45e6rR88Zli22UXq0TQT8a15ZYOdvPd9ZM_bJQvsC18VyRp5ssnsVIQH72SAymaFK6fjYCaVa.mp4?efg=eyJxZV9ncm91cHMiOiJbXCJpZ193ZWJfZGVsaXZlcnlfdnRzX290ZlwiXSIsInZlbmNvZGVfdGFnIjoidnRzX3ZvZF91cmxnZW4uY2Fyb3VzZWxfaXRlbS5jMi43MjAuYmFzZWxpbmUifQ&_nc_ht=scontent.cdninstagram.com&_nc_cat=106&vs=813991283943554_1262551654&_nc_vs=HBksFQIYOnBhc3N0aHJvdWdoX2V2ZXJzdG9yZS9HSjM1NWhqUk1KTzhqS2dCQUQzLUdydVduUVphYmtZTEFBQUYVAALIAQAVAhg6cGFzc3Rocm91Z2hfZXZlcnN0b3Jl..."
  },
  "showVideoControls": false
}

Because they use React to save data so it's not easy to get data and pass it to extension scope (isolated execution) and it will cause performance issue. You will see my extension load data faster then Instagram itself if you press Download fast enough

  • I have to click on comments & open video/image in the model for the extension to work
  • Can it work directly from the home screen. Is it possible ? or some constraints because of which this is implemented like this ?
HOAIAN2 commented 4 months ago
  • I have to click on comments & open video/image in the model for the extension to work
  • Can it work directly from the home screen. Is it possible ? or some constraints because of which this is implemented like this ?

image So late, but now I have free time, and I'm implementing that.

HOAIAN2 commented 4 months ago

Almost done, I'm testing your request right now. You can clone main branch to test it. https://github.com/HOAIAN2/Instagram-Downloader/commit/e6d6834d6ccac9ed79ea08f2d1a27c12e149d16f

HOAIAN2 commented 4 months ago

Done in release 5.1.0: https://github.com/HOAIAN2/Instagram-Downloader/releases/tag/v5.1.0