dilame / instagram-private-api

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

Error with Countdown Sticker for Stories #1254

Open MathisSnikpic opened 4 years ago

MathisSnikpic commented 4 years ago

Bug Report

Read the Notes and fill out the form.

Form

Put an [x] if you meet the condition, else leave [ ].

Requirements

Description

A specific description of your bug, so it's understandable to anyone. If you have pictures or videos to upload, please add a link like this: [title](url).

Hi, I encounter an error when publishing stories with the countdown sticker. I've tried to reproduce the given example with js DateTime.local().plus(Duration.fromObject({ hours: 1 })); but I still get the error. Here is the portion of the code, the stickerbuilder is already declared and the .build() comes after. The login works properly, even publishing stories with other stickers work fine apart from the chat one. Here is an example of the argument I pass to the function: { "text" : "Happy new year", "endTime" : 1597143191 }

Code

Add a meaningful section of your code here. If you are using TypeScript replace js with typescript.


stickerBuilder.add(
                StickerBuilder.countdown({
                    text: countdown.text,
                    endTs: countdown.endTime,
                    // x: countdown.x,
                    // y: countdown.y,
                    // width: countdown.width,
                    // height: countdown.height
                }),
            )

Error and Output

If you've got an error put it here. You can get the stacktrace in the most environments using Error.stack (MDN Docs).

IgResponseError: POST /api/v1/media/configure_to_story/ - 500 Internal Server Error; Unknown Server Error.
creativefctr commented 4 years ago

I am getting the same error with slider, it used to work fine previously.

IgResponseError: POST /api/v1/media/configure_to_story - 500 Internal Server Error; Unknown Server Error.

KeivanAbdi commented 3 years ago

I found out what was causing this. This code: https://github.com/dilame/instagram-private-api/blob/333d909565b21d962882b89c8f9a6e5ae0f8028e/src/sticker-builder/stickers/insta-sticker.ts#L73 It converts "endTs" to "endts" instead of "end_ts" and therefore Instagram is not getting what it wants and everything goes south.