Comments (4)
Cannot repeat.
from baidupcs.
I think err_no=18
corresponds to this screen:
If that is the case, then we can treat it as no error occurred. I will look through the JS to figure out how the error codes are mapped later.
from baidupcs.
Here's the error code map:
lang.errMsg.login = {
'-1': {
msg: '系统错误,请您稍后再试,<a href="http://passport.baidu.com/v2/?ucenterfeedback#{urldata}#login" target="_blank">问题反馈</a>',
field: ''
},
'1': {
msg: '您输入的帐号格式不正确',
field: 'userName'
},
'2': {
msg: '您输入的帐号不存在,可<a href=\'http://passport.baidu.com/v2/?ucenterfeedback#{urldata}#login_7\' target=\'_blank\'>查看帮助</a>或<a href=\'http://passport.baidu.com/v2/?reg#{urldata}\' target=\'_blank\'>立即注册</a>',
field: 'userName'
},
'3': {
msg: '验证码不存在或已过期,请重新输入',
field: ''
},
'4': {
msg: '您输入的帐号或密码有误,<a href="http://passport.baidu.com/?getpassindex#{urldata}" target="_blank" >忘记密码</a>?',
field: 'password'
},
'5': {
msg: '请在弹出的窗口操作,或重新登录',
field: ''
},
'6': {
msg: '您输入的验证码有误',
field: 'verifyCode'
},
'7': {
msg: '密码错误,可以试试<a onclick="var smDom=document.getElementsByClassName(\'pass-sms-btn\');if(smDom.length>0){smDom[0].click();}" >短信登录\r\n</a>,或者<a href="http://passport.baidu.com/?getpassindex#{urldata}" target="_blank" >找回密码</a>',
field: 'password'
},
'16': {
msg: '您的帐号因安全问题已被限制登录,<a href="http://passport.baidu.com/v2/?ucenterfeedback#{urldata}#login" target="_blank" >问题反馈</a>',
field: ''
},
'257': {
msg: '请输入验证码',
field: 'verifyCode'
},
'100027': {
msg: '百度正在进行系统升级,暂时不能提供服务,敬请谅解',
field: ''
},
'120016': {
msg: '',
field: ''
},
'18': {
msg: '',
field: ''
},
'400031': {
msg: '请在弹出的窗口操作,或重新登录',
field: ''
},
'400032': {
msg: '',
field: ''
},
'400034': {
msg: '',
field: ''
},
'401007': {
msg: '您的手机号关联了其他帐号,请选择登录',
field: ''
},
'120021': {
msg: '登录失败,请在弹出的窗口操作,或重新登录',
field: ''
},
'500010': {
msg: '登录过于频繁,请24小时后再试',
field: ''
},
'200010': {
msg: '验证码不存在或已过期',
field: ''
},
'100005': {
msg: '系统错误,请您稍后再试',
field: ''
},
'120019': {
msg: '请在弹出的窗口操作,或重新登录',
field: 'userName'
},
'110024': {
msg: '此帐号暂未激活,<a href="#{gotourl}" >重发验证邮件</a>',
field: ''
},
'100023': {
msg: '开启Cookie之后才能登录,<a href="http://passport.baidu.com/v2/?ucenterfeedback#{urldata}#login" target="_blank" >如何开启</a>?',
field: ''
},
'17': {
msg: '您的帐号已锁定,请<a href=\'http://passport.baidu.com/v2/?ucenterfeedback#login_10\' target=\'_blank\'>解锁</a>后登录',
field: 'userName'
},
'400401': {
msg: '',
field: ''
},
'400037': {
msg: '',
field: ''
}
};
So I think we should only be attempting the captcha when err_no is 3
, 6
, 257
, or 200010
.
This is the current code in pcs.c:
if (error == 0) {
if (pcs_islogin(pcs) == PCS_LOGIN) {
// ...
return PCS_OK;
}
else {
// ...
return PCS_FAIL;
}
}
else if (error == 4) {
// Handle invalid password...
}
else {
if (code_string) pcs_free(code_string);
code_string = pcs_get_embed_query_token_by_key(html, "&codestring");
// Handle captcha...
}
I have not tested this yet (for some reason I don't get captchas), but something like this should fix the problem:
if (error == 4) {
// Handle invalid password...
}
else if (error == 3 || error == 6 || error == 257 || error == 200010) {
if (code_string) pcs_free(code_string);
code_string = pcs_get_embed_query_token_by_key(html, "&codestring");
// Handle captcha...
}
else {
if (pcs_islogin(pcs) == PCS_LOGIN) {
// ...
return PCS_OK;
}
else {
// ...
return PCS_FAIL;
}
}
from baidupcs.
Thanks. Fixed via 4510dfd
from baidupcs.
Related Issues (20)
- Error: Can't create download thread.
- Why the speed turn to 0B/s when have downloaded part of the file? HOT 1
- Error: Couldn't connect to server
- ls: cannot access '/home/kk/.pcs/captcha.gif': No such file or directory HOT 1
- 下载的图片都是损坏的 HOT 1
- error_code:31200
- upload slice failed
- centos7下面编译全是错误,编译不过去 HOT 1
- cmake是不是比autoconf autotools要简洁方便啊
- .NET版本,前几天还运行的好好的,这两天都传输不成功了,好像没有断点续传了
- baidupcs login Error: Timeout was reached: http://pan.baidu.com/disk/home
- 咨询作者(维护问题) HOT 9
- Getting unreadable chinese Captcha + fails on latin letters captchas HOT 1
- 請問 Ubuntu 上有辦法使用嗎? HOT 1
- 打包安装失败 HOT 1
- mac版本下载错误
- 请教一下mac版是否用到了P2P? HOT 1
- 无法通过邮箱登录! HOT 1
- 测试一下
- Mac build fails with link problem HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from baidupcs.