ocilo / skype-http

Unofficial Skype API for Node.js via HTTP
https://ocilo.github.io/skype-http
MIT License
51 stars 24 forks source link

skpy.core.SkypeAuthException: Token file has expired #118

Closed YafengWangGitHub closed 5 years ago

YafengWangGitHub commented 5 years ago

Hi everyone, I am working with Skpy, I have used following code for two months, but this morning it suddenly returns this error ######################################################################## Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\skpy\main.py", line 67, in init self.conn.readToken() File "C:\ProgramData\Anaconda3\lib\site-packages\skpy\conn.py", line 301, in readToken raise SkypeAuthException("Token file has expired") skpy.core.SkypeAuthException: Token file has expired ######################################################################## Here is my code:

import time from pygame import mixer

while True: localtime = time.localtime(time.time()) if localtime[3] >= 9 and localtime[3] < 16: break print("already break at " + str(localtime[3]) + ":" + str(localtime[4]))

i = 0 j = 0 k = 0

Skype('xxxx', 'xxxx', ".tokens-fred.2") sk = Skype(tokenFile=".tokens-fred.2")

print(sk.conn)

print(sk.contacts["live:wyfbrowser"]) # the skype name of your contacts

print(sk.contacts["live:wyfbrowser"].chat)

mixer.init() mixer.music.load("666.mp3") # the music should be under same folder with this file

while True: j += 1 if j>8: time.sleep(200)
ms = sk.chats["xxxx.ac"].getMsgs() if len(ms)>= 10: print("init..." + str(len(ms))) elif len(ms)!=0: if i != 0: print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!") print(ms) mixer.music.play() i += 1 else: k += 1 print("checking..." + str(k))