Skip to content

Commit cfdf0f9

Browse files
committed
Merge branch neodymium001:fix-issue-226 (PR #238)
2 parents b9e6437 + 13ab1fc commit cfdf0f9

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

skpy/conn.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1+
import base64
2+
import functools
3+
import hashlib
14
import os
25
import re
3-
import functools
4-
from datetime import datetime, timedelta
56
import time
6-
from types import MethodType
7-
import hashlib
8-
import base64
7+
from datetime import datetime, timedelta
98
from pprint import pformat
9+
from types import MethodType
1010
from xml.etree import ElementTree
1111

12-
from bs4 import BeautifulSoup
1312
import requests
13+
from bs4 import BeautifulSoup
1414

15-
from .core import SkypeObj, SkypeEnum, SkypeApiException, SkypeAuthException
15+
from .core import SkypeApiException, SkypeAuthException, SkypeEnum, SkypeObj
1616

1717

1818
class SkypeConnection(SkypeObj):
@@ -141,13 +141,16 @@ def externalCall(cls, method, url, codes=(200, 201, 204, 207), **kwargs):
141141
API_URL = "https://urlp.asm.skype.com/v1/url/info"
142142
API_CONTACTS = "https://contacts.skype.com/contacts/v2"
143143
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/"
145145
# Version doesn't seem to be important, at least not for what we need.
146146
API_CONFIG = "https://a.config.skype.com/config/v1"
147+
USER_AGENT = "SkPy"
148+
SKYPE_CLIENT = "1418/9.99.0.999"
147149

148150
attrs = ("userId", "tokenFile", "connected", "guest")
149151

150-
extSess = requests.session()
152+
extSess = requests.Session()
153+
extSess.headers["User-Agent"] = USER_AGENT
151154

152155
def __init__(self):
153156
"""
@@ -160,6 +163,7 @@ def __init__(self):
160163
self.hasUserPwd = False
161164
self.msgsHost = self.API_MSGSHOST
162165
self.sess = requests.Session()
166+
self.sess.headers["User-Agent"] = self.USER_AGENT
163167
self.endpoints = {"self": SkypeEndpoint(self, "SELF")}
164168
self.syncStates = {}
165169

0 commit comments

Comments
 (0)