Navigate on openpilot without a comma prime subscription

Added functionality to use navigate on openpilot without a comma prime subscription with a custom set MapBox key.

Credit goes to DragonPilot!

https: //github.com/dragonpilot-community
This commit is contained in:
FrogAi
2024-01-12 22:39:30 -07:00
parent ae99774cf3
commit 7c2814329d
15 changed files with 297 additions and 5 deletions

View File

@@ -53,6 +53,9 @@ class RouteEngine:
if "MAPBOX_TOKEN" in os.environ:
self.mapbox_token = os.environ["MAPBOX_TOKEN"]
self.mapbox_host = "https://api.mapbox.com"
elif self.params.get_int("PrimeType") == 0:
self.mapbox_token = self.params.get("MapboxPublicKey", encoding='utf8')
self.mapbox_host = "https://api.mapbox.com"
else:
try:
self.mapbox_token = Api(self.params.get("DongleId", encoding='utf8')).get_token(expiry_hours=4 * 7 * 24)