-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sendfile only works with image=True #34
Comments
Can't seem to reproduce here -- images received fine with or without the Presumably you're not getting an exception whilst sending? Would be useful to see the raw message from both ends.
That is reasonable server behaviour, probably Skype providing a default thumbnail for a non-image. |
Here is what I get. And I can proceed to the link in this message, and download the file from there. But I need it to be sent through skype...
UPDATE: UPDATE 2: Then I logged the sender off and logged into receiver again - and I received all those files. But I still don't see them on another pc. Wtf is going on, skype :D |
Content seems reasonable... 🤔 The receiving account: which clients are you using? Does Skype for Web (or SkPy) handle the file and download as expected? Different to native (desktop/mobile) clients? If an image is sent from the receiving account, can the sending account download it (either via Skype for Web, or in SkPy)? Bonus: if you send an image via Skype for Web, and retrieve it in SkPy, is the content in the same format as the above? |
I'm using windows desktop skype client, I believe it's latest version. If I send files between desktop clients everything works as expected. And skype for web actually seems to be downloading files correctly. However after that I try to get the str(msg.file) to pass the links to the client to at least download them from the link, and it works with desktop, but it fails in skype for web with this error: CMD Error: ('400 response from POST https://bn2-client-s.gateway.messenger.live.com/v1/users/ME/conversations/8:username/messages', )
Traceback (most recent call last):
File "\cmds.py", line 51, in process
self.ms = ch.sendFile(open(path, "rb"),filename , image=img)
File "D:\Projects\Python\prjname_AI\Code\prjnameAI_Server\skpy\chat.py", line 176, in sendFile
return self.sendRaw(content=body, messagetype=msgType)
File "D:\Projects\Python\prjname_AI\Code\prjnameAI_Server\skpy\chat.py", line 81, in sendRaw
auth=SkypeConnection.Auth.RegToken, json=msg).json().get("OriginalArrivalTime")
File "D:\Projects\Python\prjname_AI\Code\prjnameAI_Server\skpy\conn.py", line 215, in __call__
raise SkypeApiException("{0} response from {1} {2}".format(resp.status_code, method, url), resp)
skpy.core.SkypeApiException: ('400 response from POST https://bn2-client-s.gateway.messenger.live.com/v1/users/ME/conversations/8:username/messages', ) |
Can you enable HTTP debugging ( |
Well, yes, but what should I look for there? And is it posible to set online status with skpy? |
It would be useful to know what's causing that error, which I won't really know unless I can see exactly what's being sent and received... SkPy essentially mocks Skype for Web, so if it works there then SkPy probably isn't mocking correctly, otherwise it's probably a bug in Skype for Web.
|
@Nixellion Is this still an issue for you? |
Well, yeah, did not fix itself :) I did not have time to research it more, but it's still not working. |
I'm not sure how to reproduce this -- I've sent various files and images, and they all seem to be received and displayed correctly in SkPy, Skype for Web, and Skype for Windows.
Given you can see the files on the sending end, and the API should give you the same message content on either end, I'm inclined to say that is a server bug with Skype? The 400 error -- if you can still reproduce that, can you include the HTTP request/response here, as noted before? Can't tell much from the traceback alone... |
I'm going to close this for now. If you can get the above, I might be able to debug this more. |
Yes, I get this ALL the time. I have other things to do right now, but I'll post it when I get back to it. |
See above, |
Reopening as I've managed to repro this now -- Skype for Web and Skype on Android behave, but a non-image file is MIA on Skype for Windows. However, looking at the message body, the image markup has changed since this was implemented (removed empty Picture via web:
Picture via SkPy:
File via web:
File via SkPy:
|
Actually, looking closer at Skype for Web, when you send a file/image, there are a number of calls to SkPy performs no such checks, which means it might be sending messages before they're ready to fetch from the receiving clients. Adding in some artificial delay doesn't seem to help. |
I encountered the same problem. An error occurred when using python+skpy to send information. Sendfile kept showing 403. Before that, sendmsg successfully sent data normally.I am sending a local html file. i'm use mac os system. python 3.8.6 skpy-version 0.10.4 error information: |
After restart of pycharm,it's work. |
I can only send images files with ch.sendfile, using this code:
So, if I use image=True, then all images are sent correctly. If I pass a non-image file with image=True, then skype receives it but does not download, just draws a big exclamation mark.
But if I send any file with image=False, then just nothing happens.
The text was updated successfully, but these errors were encountered: