ramonsaraiva / pubg-python

A python wrapper for the PUBG developer API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New telemetry exceptions

glmn opened this issue · comments

@ramonsaraiva
In official PUBG API discord server i've found that there is undocumented 403 status code if telemetry was not found on servers or no longer available. Should i make a new exception (ex. OldTelemetryError) or just return NotFoundError for 403 status code?

Examples:
https://telemetry-cdn.playbattlegrounds.com/bluehole-pubg/steam/2019/08/28/21/18/5a9cc5e2-c9d9-11e9-8db7-0a586468ab66-telemetry.json
https://telemetry-cdn.playbattlegrounds.com/bluehole-pubg/steam/2019/08/30/18/00/0fb4b2b6-cb50-11e9-a981-0a5864687231-telemetry.json

P.S. Should we limit telemetry URL only for official PUBG host telemetry-cdn.playbattlegrounds.com otherwise TelemetryURLError?

I think that's a good idea :-)

image
confirmed from API team. Will implement it soon.

When I get the URL from the API using api.matches().get(pm.id).assets[0].url where the pm.id is the match id, I get the error:

pubg_python.exceptions.TelemetryURLError: Telemetry host differs from official

This is cause by the URL that is returned when I used this approach being:

https://telemetry-cdn.pubg.com/bluehole-pubg/steam/2021/01/19/21/11/df4a505d-5a9a-11eb-a8be-3ac847233cd5-telemetry.json

which differs from the ones posted here. I'd suggest either removing the constrict that its only official sources if this project is no longer being worked on (in case the URL changes again in the future) or adding this URL to the list of legal URLs

Having prodded around here a bit, I have locally changed the clients.py to accept the pubg.com url as well. This causes further issues with KeyError: 'LogVehicleDamage' being thrown, which makes me suspect there have been changes to the telemetry data since this was last updated.

Having added the missing LogVehicleDamage and other consecutive missing classes to the events.py in domain/telemetry, I have found that using the requests library and the jsonResponse function is actually about 4 times faster than using the aforementioned function. I would suggest looking into this if this project is still active