Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Post with Image, Image size limitation (upd: mime types problem, not size) #42

Closed
keith284487 opened this issue Jul 16, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@keith284487
Copy link

keith284487 commented Jul 16, 2023

Hello,

Thx for the great work. Works very stable.
I have found an issue. When I use an image (external url) over 1mb, it fails.

Is it an API limitation or sort of a bug?

@Danie1
Copy link
Owner

Danie1 commented Jul 16, 2023

Hi, first of all, thank you so much! I appreciate to hear it :)

It may be an API limitation, although 1mb sounds a bit low.

I suggest you set the LOG_LEVEL environment variable to DEBUG, and re-run your script. Sometimes the http responses hint as to why it had failed.
Once you have this information / any additional data I can also take a look.

@Danie1 Danie1 added the enhancement New feature or request label Jul 17, 2023
@keith284487
Copy link
Author

Danie1, thank you for the answer.
It's not about size, but a mime type. Should be PNG, but identified as JPEG. I am checking further.

@keith284487
Copy link
Author

Look.
I am uploading external image as URL.
Somehow content_type is "binary/octet-stream" and I end up with "jpeg".

Also when you use on Insta image url, it gives you no content type as well.
file_name = url.split("/")[-1]

So i have deleted the conditional statement and changed url to image_url.
But I don't know how everything should work and maybe it's not even a bug.

image

@keith284487
Copy link
Author

I just made it temporary like that.
image

@keith284487 keith284487 changed the title Post with Image, Image size limitation Post with Image, Image size limitation (upd: mime types problem, not size) Jul 17, 2023
@vnetb
Copy link

vnetb commented Jul 18, 2023

see.
junhoyeo/threads-api#82

Instead of configure_text_post_app_feed, they use configure_text_post_app_sidecar

@Danie1 Danie1 added bug Something isn't working and removed enhancement New feature or request labels Jul 18, 2023
@Danie1
Copy link
Owner

Danie1 commented Jul 18, 2023

Hey @keith284487 , thanks for contributing by opening this issue and looking into this further.
I am pushing a fix to this in this PR: #52

Thanks @vnetb for referencing this. It looks like it's possible to upload more than 1 image to a post using this method. I will look into it for the upcoming versions.

I am able to fix these issues thanks to folks like you guys, who take interest in the project and contribute their time too :)

@Danie1
Copy link
Owner

Danie1 commented Jul 18, 2023

I am closing this, since it was fixed in https://github.com/Danie1/threads-api/releases/tag/v1.1.13.

Please open a new issue if another one appears.

Regarding @vnetb 's idea of multiple-images, I will try to address this in upcoming versions. You are more than welcome to open an issue for this 😃

@Danie1 Danie1 closed this as completed Jul 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants