Skip to content

Commit

Permalink
update ws connection id
Browse files Browse the repository at this point in the history
  • Loading branch information
marzzzello committed Apr 1, 2024
1 parent 13d13c7 commit e651110
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pytr/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class TradeRepublicApi:
_subscription_id_counter = 1
_previous_responses = {}
subscriptions = {}

_credentials_file = CREDENTIALS_FILE
_cookies_file = COOKIES_FILE

Expand All @@ -86,10 +86,10 @@ def __init__(self, phone_no=None, pin=None, keyfile=None, locale='de', save_cook
self.log = get_logger(__name__)
self._locale = locale
self._save_cookies = save_cookies

self._credentials_file = pathlib.Path(credentials_file) if credentials_file else CREDENTIALS_FILE
self._cookies_file = pathlib.Path(cookies_file) if cookies_file else COOKIES_FILE

if not (phone_no and pin):
try:
with open(self._credentials_file, 'r') as f:
Expand All @@ -101,8 +101,8 @@ def __init__(self, phone_no=None, pin=None, keyfile=None, locale='de', save_cook
else:
self.phone_no = phone_no
self.pin = pin



self.keyfile = keyfile if keyfile else KEY_FILE
try:
Expand Down Expand Up @@ -278,7 +278,7 @@ async def _get_ws(self):
'clientId': 'app.traderepublic.com',
'clientVersion': '5582',
}
connect_id = 30
connect_id = 31

self._ws = await websockets.connect('wss://api.traderepublic.com', ssl=ssl_context, extra_headers=extra_headers)
await self._ws.send(f'connect {connect_id} {json.dumps(connection_message)}')
Expand Down

0 comments on commit e651110

Please sign in to comment.