pytr-org / pytr

Use TradeRepublic in terminal and mass download all documents
https://pypi.org/project/pytr/
MIT License
382 stars 68 forks source link

pytr dl_docs is throwing error and cannot complete #3

Closed somebody-somewhere-over-the-rainbow closed 3 years ago

somebody-somewhere-over-the-rainbow commented 3 years ago

I tried running pytr today again to download my latest documents but I repeatedly get the following error message:

Received error message: '27 E {"errors":[{"errorCode":"UNKNOWN_ERROR","errorField":null,"errorMessage":"Unknown error","meta":{"source":"PLATFORM"}}]}'
Traceback (most recent call last):
  File "/home/alex/.local/bin/pytr", line 8, in <module>
    sys.exit(main())
  File "/home/alex/.local/lib/python3.8/site-packages/pytr/main.py", line 135, in main
    asyncio.get_event_loop().run_until_complete(dl.dl_loop())
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/alex/.local/lib/python3.8/site-packages/pytr/dl.py", line 28, in dl_loop
    _subscription_id, subscription, response = await self.tr.recv()
  File "/home/alex/.local/lib/python3.8/site-packages/pytr/api.py", line 246, in recv
    raise TradeRepublicError(subscription_id, subscription, payload)
pytr.api.TradeRepublicError: ('27', {'type': 'timelineDetail', 'id': '97ab309c-3101-45da-98f7-36d92172e041'}, {'errors': [{'errorCode': 'UNKNOWN_ERROR', 'errorField': None, 'errorMessage': 'Unknown error', 'meta': {'source': 'PLATFORM'}}]})
fsdjfhadflkjhsd commented 3 years ago

I just had the same problem. Looks like TR changed something.

nPyRoX commented 3 years ago

Unfortunately, I am receiving the same problem :-(

ffeldmann commented 3 years ago

My guess is that the header: _default_headers = {"User-Agent": "TradeRepublic/Android 24/App Version 1.1.2875"} is somehow outdated and needs an update. I do not know which Android Version/iOS can be used here, anyone an idea how to retrieve it?

marzzzello commented 3 years ago

It is not the user agent header but I updated it anyway. I published a new version which will not fail at this error but it is not really fixed yet. With the new version it is also possible to modify the filenames (see pytr dl_docs -h) Closed for now (reopen if there are still problems)

fsdjfhadflkjhsd commented 3 years ago

It is not the user agent header but I updated it anyway. I published a new version which will not fail at this error but it is not really fixed yet. With the new version it is also possible to modify the filenames (see pytr dl_docs -h) Closed for now (reopen if there are still problems)

Thanks a lot! I just tested it and so far the download worked like a charm.