Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提示输入验证码,输入正确后报错 wechatsogou.exceptions.WechatSogouVcodeOcrException: [WechatSogouAPI identify image] code: 3, msg: 验证码输入错误, 请重新输入! #205

Open
weiwosuoai opened this issue Aug 21, 2018 · 6 comments

Comments

@weiwosuoai
Copy link

下面是详细的堆栈信息, code 是 3, msg 是乱码不知道是什么情况,求大佬帮忙看下:

Traceback (most recent call last):
  File "/Users/a123123/.virtualenvs/article_spider/lib/python3.7/site-packages/wechatsogou/api.py", line 107, in __get_by_unlock
    unlock_platform(url, resp, session, unlock_callback, identify_image_callback)
  File "/Users/a123123/.virtualenvs/article_spider/lib/python3.7/site-packages/wechatsogou/api.py", line 74, in __unlock_sogou
    msg=r_unlock.get('msg')))
wechatsogou.exceptions.WechatSogouVcodeOcrException: [WechatSogouAPI identify image] code: 3, msg: ������误, 请�����

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1664, in <module>
    main()
  File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1658, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1068, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/Users/a123123/Work/PycharmProjects/ArticleSpider/ArticleSpider/shells/artilce_2_mysql.py", line 14, in <module>
    articles_dict = ws_api.get_gzh_article_by_history('新华社')
  File "/Users/a123123/.virtualenvs/article_spider/lib/python3.7/site-packages/wechatsogou/api.py", line 362, in get_gzh_article_by_history
    gzh_list = self.get_gzh_info(keyword, unlock_callback_sogou, identify_image_callback_sogou)
  File "/Users/a123123/.virtualenvs/article_spider/lib/python3.7/site-packages/wechatsogou/api.py", line 184, in get_gzh_info
    info = self.search_gzh(wecgat_id_or_name, 1, unlock_callback, identify_image_callback)
  File "/Users/a123123/.virtualenvs/article_spider/lib/python3.7/site-packages/wechatsogou/api.py", line 231, in search_gzh
    identify_image_callback=identify_image_callback)
  File "/Users/a123123/.virtualenvs/article_spider/lib/python3.7/site-packages/wechatsogou/api.py", line 111, in __get_by_unlock
    raise WechatSogouVcodeOcrException(e)
wechatsogou.exceptions.WechatSogouVcodeOcrException: [WechatSogouAPI identify image] code: 3, msg: ������误, 请�����
@liwg1995
Copy link

我也遇到这个错误,楼主解决了吗?

@weiwosuoai
Copy link
Author

没哦

@531067836
Copy link

我也遇到这个错误,我把若快打的码与图片输出,是匹配的,但是就抛异常了。而且很奇怪的是有时候是通的...

@chyroc
Copy link
Owner

chyroc commented Jan 17, 2019

试试换个ip~

@531067836
Copy link

有没可能反爬机制返回了多个验证码,现在只识别第一个...

@Tobby-Monkrold
Copy link

@531067836 @weiwosuoai 研究好久终于破案了,msg后边的乱码是搜狗微信返回验证码的提示信息编码错误,重新decode,utf-8就ok了。内容是“验证码错误”,我遇到的两者原因一是若快识别失败,问了客服他们的识别率只达到90%,遇到错误可以向若快服务器报错重新识别;另一原因貌似在再scrapy框架下,api会多获取一次验证码导致对应不上。顺带想问一下 @chyroc 作者一个小疑问,请问一下api用搜狗微信搜索时候是怎么设置cookies的呢,我翻了源代码貌似没找到,求指明一下,THX!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants