1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-11-09 22:06:47 +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 random
import sys
import time
try:
from defusedxml import ElementTree
@ -74,9 +75,9 @@ def parse_request(body):
def main(sess, serid, curef):
checktext = check(sess, serid, curef)
tv, fwid, filename, filesize, filehash = parse_check(checktext)
salt = salt()
vkh = vkhash(serid, curef, tv, fwid, salt)
updatetext = update_request(sess, serid, curef, tv, fwid, salt, vkh)
slt = salt()
vkh = vkhash(serid, curef, tv, fwid, slt)
updatetext = update_request(sess, serid, curef, tv, fwid, slt, vkh)
downloadurl = parse_request(updatetext)
print("{0}: HTTP {1}".format(filename, getcode(sess, downloadurl)))
print(downloadurl)
@ -85,5 +86,8 @@ def main(sess, serid, curef):
if __name__ == "__main__":
sess = prep_sess()
serid = "543212345000000"
curef = "PRD-63117-011"
if len(sys.argv) > 1:
curef = sys.argv[1]
else:
curef = "PRD-63764-001"
main(sess, serid, curef)