deathbycaptcha 5.0.1 → 5.0.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 +4 -4
- data/CHANGELOG.md +9 -2
- data/README.md +5 -1
- data/lib/deathbycaptcha/client.rb +12 -13
- data/lib/deathbycaptcha/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d578d0181a5e858098bc2329884daff5971f7bbd
|
4
|
+
data.tar.gz: b2681b030c07099cc78cb52dfc4382c6015d64b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1eaf72f64a8b7e83d4e7b6933d17d3d48ea14a890cae901c1aa1f3e9693f7bbdac4e85ad23ba075010714a166946668fb60cd8032aa4d3814a31cf228e80a66c
|
7
|
+
data.tar.gz: 2628bb9faeba7ee4e1438d307d3a20357bb69f3b2195afbf804add2c9d1979f48ddbc719c6f01d084e38572c76ec03b7d623f56d96733eec784d96a5e056a327
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
### Comming next
|
2
2
|
|
3
|
-
*
|
4
|
-
* Add
|
3
|
+
* Add Travis CI
|
4
|
+
* Add Code Climate
|
5
|
+
* Add Hakiri
|
6
|
+
* Add Hound
|
7
|
+
* Add Rubocop
|
8
|
+
|
9
|
+
### 5.0.1 - 2015-01-27
|
10
|
+
|
11
|
+
* Fix socket unsafe threads with Ruby < 2.2.0
|
5
12
|
|
6
13
|
### 5.0.0 - 2015-01-26
|
7
14
|
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ Or install it yourself as:
|
|
32
32
|
```ruby
|
33
33
|
# Create a client (:socket and :http clients are available)
|
34
34
|
#
|
35
|
-
client = DeathByCaptcha.new('myusername', 'mypassword', :
|
35
|
+
client = DeathByCaptcha.new('myusername', 'mypassword', :http)
|
36
36
|
```
|
37
37
|
|
38
38
|
2. **Solve a captcha**
|
@@ -114,6 +114,10 @@ When using the socket client, make sure that outgoing TCP traffic to
|
|
114
114
|
**api.dbcapi.me** to the ports in range **8123-8130** is not blocked by your
|
115
115
|
firewall.
|
116
116
|
|
117
|
+
> We are currently suggesting developers to use HTTP connection because Socket
|
118
|
+
> seems to be unstable with older Ruby versions. While we are investigating,
|
119
|
+
> consider using only HTTP connection.
|
120
|
+
|
117
121
|
#### Ruby dependencies
|
118
122
|
|
119
123
|
DeathByCaptcha >= 5.0.0 don't require specific dependencies. That saves you
|
@@ -82,22 +82,21 @@ module DeathByCaptcha
|
|
82
82
|
# @return [DeathByCaptcha::Captcha] The captcha (with solution if an error is not raised).
|
83
83
|
#
|
84
84
|
def decode!(options = {})
|
85
|
-
|
86
|
-
raw64 = load_captcha(options)
|
87
|
-
raise DeathByCaptcha::InvalidCaptcha if raw64.to_s.empty?
|
85
|
+
started_at = Time.now
|
88
86
|
|
89
|
-
|
90
|
-
|
91
|
-
sleep(self.polling)
|
92
|
-
_captcha = self.captcha(_captcha.id)
|
93
|
-
end
|
87
|
+
raw64 = load_captcha(options)
|
88
|
+
raise DeathByCaptcha::InvalidCaptcha if raw64.to_s.empty?
|
94
89
|
|
95
|
-
|
96
|
-
|
97
|
-
|
90
|
+
_captcha = self.upload(raw64)
|
91
|
+
while _captcha.text.to_s.empty?
|
92
|
+
sleep(self.polling)
|
93
|
+
_captcha = self.captcha(_captcha.id)
|
94
|
+
raise DeathByCaptcha::Timeout if (Time.now - started_at) > self.timeout
|
98
95
|
end
|
99
|
-
|
100
|
-
raise DeathByCaptcha::
|
96
|
+
|
97
|
+
raise DeathByCaptcha::IncorrectSolution if !_captcha.is_correct
|
98
|
+
|
99
|
+
_captcha
|
101
100
|
end
|
102
101
|
|
103
102
|
# Retrieve information from an uploaded captcha.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deathbycaptcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Débora Setton Fernandes, Rafael Barbolo, Rafael Ivan Garcia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.4.
|
104
|
+
rubygems_version: 2.4.3
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Ruby API for DeathByCaptcha (Captcha Solver as a Service)
|