prawn-cake / vk-requests

vk.com requests for humans. API library for vk.com
MIT License
158 stars 22 forks source link

Doesn't show the captcha #3

Closed i-Hun closed 8 years ago

i-Hun commented 8 years ago

Traceback (most recent call last): File "/home/hun/vk_loader/db_shema.py", line 12, in api = vk_requests.create_api(appid=**, login=', password='*', phone_number="---") File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/init.py", line 21, in create_api scope=scope, api_version=api_version) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 331, in init *_api_kwargs) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 356, in get_auth_api api_kwargs) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 45, in init self.renew_access_token() File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 75, in renew_access_token self._access_token = self.get_access_token() File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 117, in get_access_token self.do_login(session=s) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 148, in do_login response, login_form_data, session=session) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 232, in require_auth_captcha self.CAPTCHA_URI, response_url_dict['s'], response_url_dict['sid'])

prawn-cake commented 8 years ago

I don't see any type of exception from your traceback, please provide full traceback

i-Hun commented 8 years ago

/home/hun/python34env/bin/python /home/hun/vk_loader/test.py 2016-02-13 19:19:09,041 INFO [vk-requests] Getting access token for user '---' 2016-02-13 19:19:09,045 INFO [requests.packages.urllib3.connectionpool] Starting new HTTPS connection (1): m.vk.com 2016-02-13 19:19:09,177 INFO [requests.packages.urllib3.connectionpool] Starting new HTTPS connection (1): login.vk.com 2016-02-13 19:19:09,358 INFO [vk-requests] Captcha is needed Traceback (most recent call last): File "/home/hun/vk_loader/test.py", line 8, in api = vk_requests.create_api(app_id=5287719, login='---', password='---') File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/init.py", line 21, in create_api scope=scope, api_version=api_version) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 331, in init _api_kwargs) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 356, in get_auth_api _api_kwargs) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 45, in init self.renew_access_token() File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 75, in renew_access_token self._access_token = self.get_access_token() File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 117, in get_access_token self.do_login(session=s) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 148, in do_login response, login_form_data, session=session) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 232, in require_auth_captcha self.CAPTCHA_URI, response_url_dict['s'], response_url_dict['sid']) KeyError: 's'

Process finished with exit code 1

prawn-cake commented 8 years ago

hmm..this is a part derived from vk library. could you manually put some logger.info(response_url_dict) function to auth.py:230 and give traceback with this logger line again, because it hard to reproduce in unittests

i-Hun commented 8 years ago

2016-02-13 19:31:07,810 INFO [vk-requests] Getting access token for user '---' 2016-02-13 19:31:07,816 INFO [requests.packages.urllib3.connectionpool] Starting new HTTPS connection (1): m.vk.com 2016-02-13 19:31:07,939 INFO [requests.packages.urllib3.connectionpool] Starting new HTTPS connection (1): login.vk.com 2016-02-13 19:31:08,162 INFO [vk-requests] Captcha is needed 2016-02-13 19:31:08,163 INFO [vk-requests] {} Traceback (most recent call last): File "/home/hun/vk_loader/test.py", line 8, in api = vk_requests.create_api(app_id=5287719, login='---', password='---') File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/init.py", line 21, in create_api scope=scope, api_version=api_version) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 332, in init _api_kwargs) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 357, in get_auth_api _api_kwargs) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 45, in init self.renew_access_token() File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 75, in renew_access_token self._access_token = self.get_access_token() File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 117, in get_access_token self.do_login(session=s) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 148, in do_login response, login_form_data, session=session) File "/home/hun/python34env/lib/python3.4/site-packages/vk_requests/auth.py", line 233, in require_auth_captcha self.CAPTCHA_URI, response_url_dict['s'], response_url_dict['sid']) KeyError: 's'

prawn-cake commented 8 years ago

huh..it's empty well, one more trick, let's put logger.info('response_url_query: %s', response_url_query) to auth.py:144 and provide result

i-Hun commented 8 years ago

This line was added: 2016-02-13 19:44:10,660 INFO [vk-requests] response_url_query: {'s': '0', 'email': '---', 'dif': '1', 'role': 'fast', 'sid': '233322543364'}

prawn-cake commented 8 years ago

ok, got the problem I'll release bugfix soon

i-Hun commented 8 years ago

thanks!

prawn-cake commented 8 years ago

OK, I pushed it to develop, let's do this way:

If it's ok I'll release new version

i-Hun commented 8 years ago

Suddenly the problem is gone and everything works without modifications, so I can't reproduce it. If I face this error again I will try your method. Thanks a lot anyway!

prawn-cake commented 8 years ago

Problem is gone away because you no longer required a captcha and that method isn't applied. OK, consider that it has been fixed.

prawn-cake commented 8 years ago

Fixed in v0.9.2