jacopo-j / TrenitaliaAPI

Reverse engineering dell'API dell'app di Trenitalia
https://blog.jacopojannone.com/2018/09/24/trenitalia-app-reversed.html
MIT License
37 stars 6 forks source link

Error 401 during library init #5

Closed n1zzo closed 5 years ago

n1zzo commented 5 years ago

Hi, the creation of the TrenitaliaBackend class fails with an HTTP 401 error, is some kind of additional authentication required?

>>> tb = TrenitaliaBackend()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "./trenitalia.py", line 84, in __init__
    self._authenticate()
  File "./trenitalia.py", line 116, in _authenticate
    r.raise_for_status()
  File "/usr/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://gw71.mplat.trenitalia.it:444/Trenitalia50/apps/services/api/Trenitalia/android/init
jacopo-j commented 5 years ago

Looks like Trenitalia changed something in their API, gonna look into it