mirror of
https://github.com/mbirth/tcl_ota_check.git
synced 2024-11-10 06:16:46 +00:00
This commit is contained in:
parent
54918cfe3d
commit
1543649426
12
tclcheck.py
12
tclcheck.py
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user