Skip to content

Commit

Permalink
#7 ERROR_NO_SUCH_METHOD fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gotlium committed Mar 12, 2015
1 parent 60e3e71 commit 4afee26
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Installation:

.. code-block:: bash
$ sudo pip install antigate
$ pip install antigate
Usage:
------
Expand Down
4 changes: 3 additions & 1 deletion antigate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def __init__(self, key, captcha_file='', auto_run=True,
grab_config=None, send_config=None,
domain='antigate.com', binary=False):
self.g = Grab()
self.g.setup(timeout=30)
if grab_config:
self.g.setup(**grab_config)
self.key = key
Expand Down Expand Up @@ -97,7 +98,8 @@ def _send(self, captcha_file, binary=False):
))
else:
self.g.setup(multipart_post=self._update_params(
{'key': self.key, 'file': UploadFile(captcha_file)},
{'method': 'post', 'key': self.key,
'file': UploadFile(captcha_file)},
self.send_config
))
self._go(self._get_input_url(), 'Can not send captcha')
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='antigate',
version="1.3",
version="1.3.1",
description='Easy wrapper for antigate.com',
keywords="antigate captcha",
long_description=open('README.rst').read(),
Expand Down
4 changes: 2 additions & 2 deletions test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from antigate import AntiGate

API_KEY = "e40fba1aabd4acf4266183acd661d8c1"
API_KEY = "21fbd2f052b446aaf3b243df10120f20"
IMAGE1 = "captcha/123.jpg"
IMAGE2 = "captcha/456.jpg"

Expand All @@ -16,7 +16,7 @@ def test_stats(self):
self.assertTrue(len(AntiGate(API_KEY).stats()) > 0)

def test_load(self):
self.assertEqual(len(AntiGate(API_KEY).load()), 4)
self.assertTrue(len(AntiGate(API_KEY).load()) > 0)

def test_base(self):
self.assertEqual(str(AntiGate(API_KEY, IMAGE1)), '123')
Expand Down

0 comments on commit 4afee26

Please sign in to comment.