def _login_init(self): #死方法来手动每次更新deviceid url url_info = copy.deepcopy(self._urlInfo["getDevicesId"]) url_info['url'] = self._urlInfo["getDevicesId"]['url'] + str( int(time.time() * 1000)) devices_id_rsp = EasyHttp.get_custom(url_info) # params = {"algID": request_alg_id(self._urlInfo['getJS']), "timestamp": int(time.time() * 1000)} # params = dict(params, **get_hash_code_params()) # devices_id_rsp = EasyHttp.send(self._urlInfo["getDevicesId"],params=params) if devices_id_rsp: callback = devices_id_rsp.text[18:-2] # callback = devices_id_rsp.replace("callbackFunction('", '').replace("')", '') try: text = json.loads(callback) devices_id = text.get('dfp') exp = text.get('exp') except Exception as e: return False, '获取设备指纹失败' EasyHttp.setCookies(RAIL_DEVICEID=devices_id, RAIL_EXPIRATION=exp) # Log.d('设备Id:%s'%devices_id) return True, '获取设备指纹成功' EasyHttp.send(self._urlInfo['index']) EasyHttp.send(self._urlInfo['loginInit']) return False, '获取设备指纹失败'
def _handle_device_code_auto(self): status, cookie = get12306Cookie() if not status: return False, cookie EasyHttp.setCookies(RAIL_DEVICEID=cookie['RAIL_DEVICEID'], RAIL_EXPIRATION=cookie['RAIL_EXPIRATION']) return True, '获取设备指纹成功'
def _login_init(self): EasyHttp.send(self._urlInfo['loginInit']) devices_id_rsp = EasyHttp.get_custom(self._urlInfo["getDevicesId"]) if devices_id_rsp: callback = devices_id_rsp.text.replace("callbackFunction('", '').replace("')", '') text = json.loads(callback) devices_id = text.get('dfp') exp = text.get('exp') EasyHttp.setCookies(RAIL_DEVICEID=devices_id,RAIL_EXPIRATION=exp) # Log.d('设备Id:%s'%devices_id) return True,'获取设备指纹成功' return False,'获取设备指纹失败'
def _login_init(self): url_info = copy.deepcopy(self._urlInfo["getDevicesId"]) url_info['url'] = self._urlInfo["getDevicesId"]['url'] + str(int(time.time()*1000)) devices_id_rsp = EasyHttp.get_custom(url_info) if devices_id_rsp: callback = devices_id_rsp.text.replace("callbackFunction('", '').replace("')", '') text = json.loads(callback) devices_id = text.get('dfp') exp = text.get('exp') EasyHttp.setCookies(RAIL_DEVICEID=devices_id, RAIL_EXPIRATION=exp) # Log.d('设备Id:%s'%devices_id) return True, '获取设备指纹成功' EasyHttp.send(self._urlInfo['index']) EasyHttp.send(self._urlInfo['loginInit']) return False,'获取设备指纹失败'