whtsky / PyWapFetion

A simple Fetion lib for Python.
72 stars 43 forks source link

验证码读取失败 #15

Closed juejuelittle closed 12 years ago

juejuelittle commented 12 years ago
captcha = codekey.findall(page)[0]

IndexError: list index out of range

crook commented 12 years ago

yes, I also met this issue. codekey.findall(page) return [] list

falconchen commented 12 years ago

html5版本的Fetion不再使用base64的傻瓜式验证码了,现在只能手动输入验证码模拟登录一次并保存cookie到本地来重复使用,貌似一次能用三个月吧。

falconchen commented 12 years ago

然而终究只是我的临时解决方案,只能凑合着用,期待验证码自动识别的版本, 另外发现加好友不仅有每日次数限制,居然还有每月次数限制!这个月都不能主动加好友了。。。

whtsky commented 12 years ago

https://github.com/whtsky/PyWapFetion/commit/8f082d7ee0c227a3723427f1fe467654f2b0f14f 我尝试着修改了一下,但是目前的情况是,程序下载到的验证码图片都是很残缺不全的。。(像这样: http://ww2.sinaimg.cn/large/6556c8a2tw1dwhchj7c0tj.jpg) 有人能解决么= =

falconchen commented 12 years ago

在Windows下用urllib2下载一些图片是有残缺的现象,同样的代码在cygwin下则没有,挺奇怪的,我也不清楚这是怎么回事,难道跟buffer有关?

我也来试试

whtsky commented 12 years ago

@falconchen 目前手头只有一台Windows了..你去试试吧,只要在*nix下没问题就行..

falconchen commented 12 years ago

在Win下用binary模式貌似可以完整写入图像,open('verifycode.jpeg', 'wb')

falconchen commented 12 years ago

因为没用过pickle,所以用MozillaCookieJar做了个简陋的实现,在win/cygwin下测试没问题。 https://github.com/falconchen/PyWapFetion/commit/98ea921d9a486edf82437e37d26f67a4cc16e765

whtsky commented 12 years ago

发pull request吧..