[ADD]: Random ID patch #21

Open
opened 2021-08-31 09:32:12 +01:00 by pavlinux · 0 comments
pavlinux commented 2021-08-31 09:32:12 +01:00 (Migrated from github.com)
--- a/grmn/updateserver.py
+++ b/grmn/updateserver.py
@@ -9,7 +9,10 @@ from . import devices
 from .proto import GetAllUnitSoftwareUpdates_pb2
 from xml.dom.minidom import getDOMImplementation, parseString
 from urllib.parse import unquote
+import random
+import string
 import requests
+import cloudscraper
 
 PROTO_API_GETALLUNITSOFTWAREUPDATES_URL = "http://omt.garmin.com/Rce/ProtobufApi/SoftwareUpdateService/GetAllUnitSoftwareUpdates"
 WEBUPDATER_SOFTWAREUPDATE_URL = "https://www.garmin.com/support/WUSoftwareUpdate.jsp"
@@ -109,7 +112,8 @@ class UpdateInfo:
 class UpdateServer:
 
     def __init__(self):
-        self.device_id = "2345678910"
+        rnd_id = ''.join(random.choice(string.digits) for i in range(10))
+        self.device_id = rnd_id
         self.unlock_codes = []
         self.debug = False
 
```diff --- a/grmn/updateserver.py +++ b/grmn/updateserver.py @@ -9,7 +9,10 @@ from . import devices from .proto import GetAllUnitSoftwareUpdates_pb2 from xml.dom.minidom import getDOMImplementation, parseString from urllib.parse import unquote +import random +import string import requests +import cloudscraper PROTO_API_GETALLUNITSOFTWAREUPDATES_URL = "http://omt.garmin.com/Rce/ProtobufApi/SoftwareUpdateService/GetAllUnitSoftwareUpdates" WEBUPDATER_SOFTWAREUPDATE_URL = "https://www.garmin.com/support/WUSoftwareUpdate.jsp" @@ -109,7 +112,8 @@ class UpdateInfo: class UpdateServer: def __init__(self): - self.device_id = "2345678910" + rnd_id = ''.join(random.choice(string.digits) for i in range(10)) + self.device_id = rnd_id self.unlock_codes = [] self.debug = False ```
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mbirth/gcd-parser#21
No description provided.