1
+ import base64
2
+ import functools
3
+ import hashlib
1
4
import os
2
5
import re
3
- import functools
4
- from datetime import datetime , timedelta
5
6
import time
6
- from types import MethodType
7
- import hashlib
8
- import base64
7
+ from datetime import datetime , timedelta
9
8
from pprint import pformat
9
+ from types import MethodType
10
10
from xml .etree import ElementTree
11
11
12
- from bs4 import BeautifulSoup
13
12
import requests
13
+ from bs4 import BeautifulSoup
14
14
15
- from .core import SkypeObj , SkypeEnum , SkypeApiException , SkypeAuthException
15
+ from .core import SkypeApiException , SkypeAuthException , SkypeEnum , SkypeObj
16
16
17
17
18
18
class SkypeConnection (SkypeObj ):
@@ -141,13 +141,16 @@ def externalCall(cls, method, url, codes=(200, 201, 204, 207), **kwargs):
141
141
API_URL = "https://urlp.asm.skype.com/v1/url/info"
142
142
API_CONTACTS = "https://contacts.skype.com/contacts/v2"
143
143
API_MSGSHOST = "https://client-s.gateway.messenger.live.com/v1"
144
- API_DIRECTORY = "https://skypegraph.skype.com/search/v1.1/namesearch/swx /"
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
+ USER_AGENT = "SkPy"
148
+ SKYPE_CLIENT = "1418/9.99.0.999"
147
149
148
150
attrs = ("userId" , "tokenFile" , "connected" , "guest" )
149
151
150
- extSess = requests .session ()
152
+ extSess = requests .Session ()
153
+ extSess .headers ["User-Agent" ] = USER_AGENT
151
154
152
155
def __init__ (self ):
153
156
"""
@@ -160,6 +163,7 @@ def __init__(self):
160
163
self .hasUserPwd = False
161
164
self .msgsHost = self .API_MSGSHOST
162
165
self .sess = requests .Session ()
166
+ self .sess .headers ["User-Agent" ] = self .USER_AGENT
163
167
self .endpoints = {"self" : SkypeEndpoint (self , "SELF" )}
164
168
self .syncStates = {}
165
169
0 commit comments