two_captcha 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6301e1e7e1da13c43d29f53d7e11b79ec5eebca
4
- data.tar.gz: f0fbd0102bce7465dd5bde5579bb1cf37fa318ce
3
+ metadata.gz: 59c78a3d0fc1086113ee19839c34915f2ee25dfd
4
+ data.tar.gz: 93324acc8b929a1ce9afd091854fb613a65b1880
5
5
  SHA512:
6
- metadata.gz: 90125e1512e0a06e196ac13d046d487b54a8893d49ca898ee7858de340e2507dac17e410d3a6cd8e70658893af10bbaa7a8a76519c216d5a9a99984a5728890a
7
- data.tar.gz: 5f315e743b1521c3c062ae1f9138e2a6e180f6e776378c2f1ab0efada8edb0b8f37b29b85fc4294eb38178c4c86027c79a6a40c3157376f1d1ca2ef9ebbfec7b
6
+ metadata.gz: 1bbb44cd113201bc56e8f1a29bc3f933a5a0e2e9f5fc90eb69c33c381768ca8b3822ac1175a64289e52e8bbe6bb2d3a525587704388c57865fb6582460de7288
7
+ data.tar.gz: 4cd54178eefe7b37bf5a21451bf35cbd8d03a03056bb8c9783756198f6e8591820ceba41b7a373e902415a51801685212040dbafe586a27eda428dff9fa7325d
@@ -121,16 +121,14 @@ module TwoCaptcha
121
121
  }
122
122
 
123
123
  response_res = request('res', :get, payload_res)
124
- result = JSON.load(response_res)
125
124
 
126
- while ['CAPCHA_NOT_READY', 'CAPTCHA_NOT_READY'].include? result['request']
125
+ while response_res.match(/CAPTCHA_NOT_READY|CAPCHA_NOT_READY/i)
127
126
  sleep(polling)
128
127
  response_res = request('res', :get, payload_res)
129
- result = JSON.load(response_res)
130
128
  fail TwoCaptcha::Timeout if (Time.now - started_at) > timeout
131
129
  end
132
130
 
133
- result['request']
131
+ JSON.load(response_res)['request']
134
132
  end
135
133
 
136
134
  # Upload a captcha to 2Captcha.
@@ -1,4 +1,4 @@
1
1
  module TwoCaptcha
2
- VERSION = '1.3.1'
2
+ VERSION = '1.3.2'
3
3
  USER_AGENT = "TwoCaptcha/Ruby v#{VERSION}"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: two_captcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael Barbolo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-07 00:00:00.000000000 Z
12
+ date: 2017-02-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler