1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-11-10 06:16:46 +00:00
This commit is contained in:
thurask 2017-08-08 00:24:16 -04:00 committed by GitHub
parent 54918cfe3d
commit 1543649426

View File

@ -1,5 +1,6 @@
import hashlib import hashlib
import random import random
import sys
import time import time
try: try:
from defusedxml import ElementTree from defusedxml import ElementTree
@ -74,9 +75,9 @@ def parse_request(body):
def main(sess, serid, curef): def main(sess, serid, curef):
checktext = check(sess, serid, curef) checktext = check(sess, serid, curef)
tv, fwid, filename, filesize, filehash = parse_check(checktext) tv, fwid, filename, filesize, filehash = parse_check(checktext)
salt = salt() slt = salt()
vkh = vkhash(serid, curef, tv, fwid, salt) vkh = vkhash(serid, curef, tv, fwid, slt)
updatetext = update_request(sess, serid, curef, tv, fwid, salt, vkh) updatetext = update_request(sess, serid, curef, tv, fwid, slt, vkh)
downloadurl = parse_request(updatetext) downloadurl = parse_request(updatetext)
print("{0}: HTTP {1}".format(filename, getcode(sess, downloadurl))) print("{0}: HTTP {1}".format(filename, getcode(sess, downloadurl)))
print(downloadurl) print(downloadurl)
@ -85,5 +86,8 @@ def main(sess, serid, curef):
if __name__ == "__main__": if __name__ == "__main__":
sess = prep_sess() sess = prep_sess()
serid = "543212345000000" serid = "543212345000000"
curef = "PRD-63117-011" if len(sys.argv) > 1:
curef = sys.argv[1]
else:
curef = "PRD-63764-001"
main(sess, serid, curef) main(sess, serid, curef)