@@ -144,7 +144,10 @@ def externalCall(cls, method, url, codes=(200, 201, 204, 207), **kwargs):
144
144
API_DIRECTORY = "https://skypegraph.skype.com/v2.0/search/"
145
145
# Version doesn't seem to be important, at least not for what we need.
146
146
API_CONFIG = "https://a.config.skype.com/config/v1"
147
+
147
148
USER_AGENT = "SkPy"
149
+ USER_AGENT_BROWSER = ("Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) "
150
+ "Chrome/33.0.1750.117 Safari/537.36" )
148
151
SKYPE_CLIENT = "1418/9.99.0.999"
149
152
150
153
attrs = ("userId" , "tokenFile" , "connected" , "guest" )
@@ -822,10 +825,8 @@ def auth(self, url, name):
822
825
"""
823
826
urlId = url .split ("/" )[- 1 ]
824
827
# Pretend to be Chrome on Windows (required to avoid "unsupported device" messages).
825
- agent = "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) " \
826
- "Chrome/33.0.1750.117 Safari/537.36"
827
828
cookies = self .conn ("GET" , "{0}/{1}" .format (SkypeConnection .API_JOIN , urlId ),
828
- headers = {"User-Agent" : agent }).cookies
829
+ headers = {"User-Agent" : SkypeConnection . USER_AGENT_BROWSER }).cookies
829
830
ids = self .conn ("POST" , "{0}/api/v2/conversation/" .format (SkypeConnection .API_JOIN ),
830
831
json = {"shortId" : urlId , "type" : "wl" }).json ()
831
832
token = self .conn ("POST" , "{0}/api/v1/users/guests" .format (SkypeConnection .API_JOIN ),
0 commit comments