1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-11-10 06:16:46 +00:00

Add method to reset session for multiple update checks for different

PRDs.
This commit is contained in:
Markus Birth 2017-09-01 17:58:00 +02:00
parent 03dc98b4e2
commit d864a2002a

View File

@ -38,10 +38,16 @@ class FotaCheck:
self.cktp = self.CKTP_CHECKMANUAL self.cktp = self.CKTP_CHECKMANUAL
self.rtd = self.RTD_UNROOTED self.rtd = self.RTD_UNROOTED
self.chnl = self.CHNL_WIFI self.chnl = self.CHNL_WIFI
self.sess = requests.Session() self.reset_session()
def reset_session(self):
self.g2master = self.get_master_server() self.g2master = self.get_master_server()
#self.req.headers.update({"User-Agent": "com.tcl.fota/5.1.0.2.0029.0, Android"}) self.sess = requests.Session()
self.sess.headers.update({"User-Agent": "tcl"}) if self.mode == self.MODE_FULL:
self.sess.headers.update({"User-Agent": "com.tcl.fota/5.1.0.2.0029.0, Android"})
else:
self.sess.headers.update({"User-Agent": "tcl"})
return self.sess
@staticmethod @staticmethod
def get_salt(): def get_salt():