diff --git a/README.rst b/README.rst index 35aa550..9237124 100644 --- a/README.rst +++ b/README.rst @@ -31,7 +31,7 @@ Installation: .. code-block:: bash - $ sudo pip install antigate + $ pip install antigate Usage: ------ diff --git a/antigate/__init__.py b/antigate/__init__.py index 27d5deb..4ce960b 100644 --- a/antigate/__init__.py +++ b/antigate/__init__.py @@ -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 @@ -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') diff --git a/setup.py b/setup.py index c4d0fca..28a4534 100755 --- a/setup.py +++ b/setup.py @@ -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(), diff --git a/test_cases.py b/test_cases.py index 8f907e1..36ab574 100644 --- a/test_cases.py +++ b/test_cases.py @@ -3,7 +3,7 @@ from antigate import AntiGate -API_KEY = "e40fba1aabd4acf4266183acd661d8c1" +API_KEY = "21fbd2f052b446aaf3b243df10120f20" IMAGE1 = "captcha/123.jpg" IMAGE2 = "captcha/456.jpg" @@ -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')