-
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
skpy.core.SkypeApiException since today 10/08/2020 #146
Comments
Reiterating points in the issue template that you didn't include:
|
Hi, thanks for replying. The issue happend with both chat types but today is working fine. I think the issue was related to some server the api tried to connect to and received this 400 message:
I'll keep you informed if it happen again with the debug output. Thanks |
Hi Terrace, the issue is happening again with 1-to-1 and group conversations. I setted SKPY_DEBUG_HTTP=1 as you asked before and received this:
I read the documentation but didn't find out a way to send startTime or startComposeTime parameters to the messages. Can you help me? Thanks! |
Looks like Skype for Web sends a compose time now, I wonder if that's what it's complaining about. I can't reproduce the error with any of my test contacts, but if it's still failing can you try adding this (line 139 of skpy/chat.py): diff --git skpy/chat.py skpy/chat.py
index 12c249d..1c4649c 100644
--- skpy/chat.py
+++ skpy/chat.py
@@ -137,4 +137,5 @@ class SkypeChat(SkypeObj):
clientTime = int(time.time() * 1000)
msg["clientmessageid"] = str(clientTime)
+ msg["composetime"] = "{0}Z".format(datetime.utcnow().isoformat()[:23])
msgId, arriveTime = self.createRaw(msg)
arriveDate = datetime.fromtimestamp(arriveTime / 1000) if arriveTime else datetime.now() ( |
Your workaround makes sense but sadly It's no longer failing so I can't test it... Thanks |
Hi Terrace. The issue is happening again, I tried your line but didn't worked.
|
Unless I can see what your account does normally in Skype for Web (you'll need to inspect the web traffic in a browser when you send a message), I can't reproduce the problem so I'm unsure how to fix it. It's particularly odd given it only fails some of the time, presumably from a change of messaging host. |
You can use chat = sk.chats["8:joe.4"]
msg = chat.sendRaw(
messagetype="RichText",
contenttype="text",
content="Hello",
imdisplayname="Fred Adams",
receiverdisplayname="Joe Bloggs",
) Note that chat.createRaw({
"clientmessageid": "1603753046123",
"composetime": "2020-10-26T22:57:26.123Z",
"messagetype": "RichText",
"contenttype": "text",
"content": "Hello",
"imdisplayname": "Fred Adams",
"receiverdisplayname": "Joe Bloggs",
}) See also |
Thanks for the info! PS: I never hoped so much that something start to failing again as I do right now :D |
Since today I'm receiving a SkypeApiException that stops my script. Something I discovered is it matches with a new update made by Microsoft during last night.
This is my code:
And this is the output:
C:\Users\cdanieri\python_projects\jira>python test.py
No voy a usar proxy
[SkypeContact]
Id: ballarati
Name: Federico Ballarati | 542596
Location: Ciudad Autónoma de Buenos Aires, AR
Language: ES
Avatar: https://avatar.skype.com/v1/avatars/ballarati?auth_key=-xxxxxxxxxxx
Mood: None
Phones: +54xxxxxxxxxxx
+54xxxxxxxxxx
Birthday: 1970-07-12
Authorised: True
Blocked: False
Favourite: False
Traceback (most recent call last):
File "test.py", line 38, in
chat.sendMsg("this is a message")
File "C:\Users\cdanieri\AppData\Local\Programs\Python\Python38\lib\site-packages\skpy\chat.py", line 201, in sendMsg
return self.sendRaw(editId=edit, messagetype=msgType, content=content,
File "C:\Users\cdanieri\AppData\Local\Programs\Python\Python38\lib\site-packages\skpy\chat.py", line 138, in sendRaw
msgId, arriveTime = self.createRaw(msg)
File "C:\Users\cdanieri\AppData\Local\Programs\Python\Python38\lib\site-packages\skpy\chat.py", line 74, in createRaw
resp = self.skype.conn("POST", "{0}/users/ME/conversations/{1}/messages"
File "C:\Users\cdanieri\AppData\Local\Programs\Python\Python38\lib\site-packages\skpy\conn.py", line 219, in call
raise SkypeApiException("{0} response from {1} {2}".format(resp.status_code, method, url), resp)
skpy.core.SkypeApiException: ('400 response from POST https://azwcus1-client-s.gateway.messenger.live.com/v1/users/ME/conversations/8:ballarati/messages', <Response [400]>)
The text was updated successfully, but these errors were encountered: