|
发表于 2018-5-6 21:26:35
|
显示全部楼层
強大 修改代碼後顯示如下: 請參考
{'deviceId': 'wb_26283e42-bd17-435d-9fd6-d0db365675f2', 'pass_trace': 'ga8bp4BxxtQhPgnOA5ocVUUrAuDVwaBoYiczOf3oc6emP2KzlLpxYW5/xNe2OjD3JYvRn3jmrBxS40Rxkb14bwj7UB2+TuZ2HJlWWH4Ch2Kgkuxv9KtEDTgYVgX8ZK1A', 'uLocale': 'zh_CN', 'JSESSIONID': 'aaa7ILExYaZ_a7nEFPLmw'}
<!doctype html>
<meta name="description" content="小米帐号能使用小米手机,MIUI,小米云,多看阅读,米聊,小米社区等小米服务。" />
<meta name="keywords" content="小米帐号,小米账号,小米注册,注册,Mi Account,Sign in,小米,帐号,账号,小米帐户,登录,登陆,安全令牌,动态口令,小米注册,找回密码" />
<script>
var _d_={};
var _t_={
statURL:'https://data.mistat.xiaomi.com/mistats',
appId:"2882303761517246742",
appKey:"5621724658742",
jspcompletenew Date()).getTime(),
supportLocalstorage:!!window.localStorage,
samplingBase:100,
samplingRate:5
};
if(window.performance){
var timing=performance.timing;
if(!timing.responseEnd){
timing.responseEnd=timing.responseStart;
}
_d_.startTS=timing.fetchStart
_d_.endTS=timing.responseEnd;
}else{
_d_.startTS=_d_.endTS=(new Date()).getTime();
}
var JSP_VAR={
deviceType:'PC',
dataCenter:'sgp',
dataCenterZone:'Singapore',
locale:"zh_CN",
region:"TW",
callback:"https://api.mina.mi.com/sts",
sid:"micoapi",
qs:"%3Fsid%3Dmicoapi",
hidden:"",
"_sign":"7r4bjQjlOIJHfZD0jfrFpfe2xLs=",
serviceParam :'{"checkSafePhone":false}',
privacyLink:'http://www.miui.com/res/doc/privacy/cn.html',
agreeLink:'http://www.miui.com/res/doc/eula/cn.html'
};
var PAGE_VAR={
form_cache:false,
cache_keyJSP_VAR.deviceType!=="mobile" ? "/static/res/25fadc9/account-static/html/login/dist/v2/sgp/login-cn.html" : "/static/res/25fadc9/account-static/html/login/dist/v2/sgp/login-wap-cn.html")
};
if(location.search.indexOf("_debugMode")>-1){
window.localStorage && window.localStorage.removeItem(PAGE_VAR.cache_key);
}
(function(){
function getLocal(url){
if(window.localStorage){
var data=localStorage.getItem(url);
return data;
}
return null;
}
function setLocal(url,data){
if(window.localStorage && data){
try{
localStorage.setItem(url,data);
}catch(e){}
}
}
function getContent(url){
var xhr= new (window.XMLHttpRequest || window.ActiveXObject)("Microsoft.XMLHTTP");
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
setLocal(url,xhr.responseText);
_t_.htmlGetEnd=(new Date()).getTime();
document.write(xhr.responseText);
document.close();
}
};
xhr.open("GET",url,false);
xhr.send();
}
var cache_key=PAGE_VAR.cache_key;
_t_.version=cache_key;
var html=getLocal(cache_key);
if(html){
_t_.htmlCache=true;
PAGE_VAR.form_cache=true;
document.write(html);
document.close();
}else{
_t_.htmlCache=false;
_t_.htmlGetStart=(new Date()).getTime();
getContent(cache_key);
}
})();
</script>
--- Logging error ---
Traceback (most recent call last):
File "hello_miai.py", line 232, in _get_logon_info
with open(self._login_info_dir+'/config.json','r',encoding='utf-8') as json_file:
FileNotFoundError: [Errno 2] No such file or directory: '../.xiaoai/config.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "hello_miai.py", line 95, in _get_sign
self._cookies['pass_ua']=self._request.cookies.get_dict()['pass_ua']
KeyError: 'pass_ua'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/logging/__init__.py", line 981, in emit
msg = self.format(record)
File "/usr/lib/python3.5/logging/__init__.py", line 831, in format
return fmt.format(record)
File "/usr/lib/python3.5/logging/__init__.py", line 568, in format
record.message = record.getMessage()
File "/usr/lib/python3.5/logging/__init__.py", line 331, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "hello_miai.py", line 256, in <module>
xiaomi_tts(miid,password,login_info_dir='../.xiaoai',can_input_capt=True).speech("Token已生成",int(num))
File "hello_miai.py", line 81, in __init__
self._get_logon_info()
File "hello_miai.py", line 238, in _get_logon_info
self._serviceToken()
File "hello_miai.py", line 158, in _serviceToken
_serviceLoginAuth2_json=self._serviceLoginAuth2()
File "hello_miai.py", line 110, in _serviceLoginAuth2
self._sign=self._get_sign() #获取sign
File "hello_miai.py", line 100, in _get_sign
_LOGGER.error('_get_sign',e)
Message: '_get_sign'
Arguments: (KeyError('pass_ua',),)
获取_sign出错!
Traceback (most recent call last):
File "hello_miai.py", line 232, in _get_logon_info
with open(self._login_info_dir+'/config.json','r',encoding='utf-8') as json_file:
FileNotFoundError: [Errno 2] No such file or directory: '../.xiaoai/config.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "hello_miai.py", line 256, in <module>
xiaomi_tts(miid,password,login_info_dir='../.xiaoai',can_input_capt=True).speech("Token已生成",int(num))
File "hello_miai.py", line 81, in __init__
self._get_logon_info()
File "hello_miai.py", line 238, in _get_logon_info
self._serviceToken()
File "hello_miai.py", line 159, in _serviceToken
if _serviceLoginAuth2_json['code']==0:
TypeError: 'NoneType' object is not subscriptable
|
|