tomer8007 / kik-bot-api-unofficial

Python API for writing unoffical Kik bots that act like humans
MIT License
126 stars 76 forks source link

People can't open pictures sent by the bot? #150

Closed Madrid-Lux closed 4 years ago

Madrid-Lux commented 4 years ago

Hey, another issue, this time I think it's a bug? When using self.client.send_chat_image(chat_message.group_jid, "test.jpg", True) It sends the picture, but on Kik when clicking on that picture, it just says "failed to load".

Madrid-Lux commented 4 years ago

I'll be playing around with chatting.py to see what could fix it. Anyone know any workarounds?

ghost commented 4 years ago

That's interesting, try the code from https://github.com/tomer8007/kik-bot-api-unofficial/issues/143

I don't recall any errors appearing from the photos that I sent using it.(and the photos that I sent were literally designed to be some sort of maxed out size bomb)

ghost commented 4 years ago

But then again, it was sent via private message rather than group chat. I don't think there should be much of a difference though if you were to just replace from_jid with group_jid.

Madrid-Lux commented 4 years ago

Would png and jpg make a difference?

EDIT: no difference nope

Madrid-Lux commented 4 years ago

Tested code from #143, still the same issue. It happens via private message & group chat too.

ghost commented 4 years ago

To get to the bottom of all of this we first need to figure out why kik outputs that error exactly. There is a reason involving networking issues and then there is the reason involving formatting issues or perhaps pixel issues, try analysing the photos that you send via camera/gallery and then try analyzing them when they are sent via API.

Madrid-Lux commented 4 years ago

Nothing new, same issue. I've noticed that changing the app names & app IDs for pictures chatting.py (attempting to fix it, the error did not come after I edited these values) really doesn't..work?

Madrid-Lux commented 4 years ago

Any updates? It would be highly appreciated! Thanks. Changing App IDs and App Names in chatting.py doesn't change anything much.

ghost commented 4 years ago

No, we are procrastinating.

sapiosaurus commented 4 years ago

It’s not a bug, it was just never implemented. The only thing that is sent is a preview of the image, not the full-size image.

On May 10, 2020, at 4:19 PM, SSHbabe notifications@github.com wrote:

 No, we are procrastinating.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

bluemods commented 4 years ago

For the image to fully upload you need to use a HTTP POST request to https://platform.kik.com/content/files/{CONTENT UUID HERE} and you need to add a bunhc of headers, some of which include your jid and hashed password, along with several hashes of the file itself (MD5, salted SHA-1, blockhash using Kik C library [apk/lib/libkikhash.so]) so if you'd be able to implement all that into python perfectly, I'd be impressed. Good luck lol

The headers I found (in double quotes) were:

(These next headers repeat for each 'chunk', I believe. You'd be best to try to upload one chunk at a time until you figure it out)

If you can figure all these hashes out, you're basically god.