Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
weboob
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
178
Issues
178
List
Boards
Labels
Milestones
Merge Requests
49
Merge Requests
49
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
weboob
weboob
Commits
f6523719
Commit
f6523719
authored
Jan 21, 2019
by
Florian Duguet
Committed by
Romain Bignon
Feb 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manage funcaptcha
Add FuncaptchaQuestion and FuncaptchaJob to manage funcaptcha
parent
fba92f46
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
weboob/capabilities/captcha.py
weboob/capabilities/captcha.py
+12
-1
weboob/exceptions.py
weboob/exceptions.py
+12
-0
No files found.
weboob/capabilities/captcha.py
View file @
f6523719
...
...
@@ -20,7 +20,7 @@
from
time
import
sleep
from
.base
import
Capability
,
BaseObject
,
StringField
,
UserError
,
BytesField
from
..exceptions
import
RecaptchaQuestion
,
NocaptchaQuestion
,
ImageCaptchaQuestion
from
..exceptions
import
RecaptchaQuestion
,
NocaptchaQuestion
,
FuncaptchaQuestion
,
ImageCaptchaQuestion
__all__
=
[
...
...
@@ -47,6 +47,12 @@ class NocaptchaJob(SolverJob):
site_key
=
StringField
(
'Site key for NoCaptcha service'
)
class
FuncaptchaJob
(
SolverJob
):
site_url
=
StringField
(
'Site URL for FunCaptcha service'
)
site_key
=
StringField
(
'Site key for FunCaptcha service'
)
sub_domain
=
StringField
(
'Required for some complex cases, but Funcaptcha integrations run without it'
)
class
ImageCaptchaJob
(
SolverJob
):
image
=
BytesField
(
'data of the image to solve'
)
...
...
@@ -76,6 +82,11 @@ def exception_to_job(exc):
job
=
NocaptchaJob
()
job
.
site_url
=
exc
.
website_url
job
.
site_key
=
exc
.
website_key
elif
isinstance
(
exc
,
FuncaptchaQuestion
):
job
=
FuncaptchaJob
()
job
.
site_url
=
exc
.
website_url
job
.
site_key
=
exc
.
website_key
job
.
sub_domain
=
exc
.
sub_domain
elif
isinstance
(
exc
,
ImageCaptchaQuestion
):
job
=
ImageCaptchaJob
()
job
.
image
=
exc
.
image_data
...
...
weboob/exceptions.py
View file @
f6523719
...
...
@@ -93,6 +93,18 @@ class RecaptchaQuestion(CaptchaQuestion):
super
(
RecaptchaQuestion
,
self
)
.
__init__
(
self
.
type
,
website_key
=
website_key
,
website_url
=
website_url
)
class
FuncaptchaQuestion
(
CaptchaQuestion
):
type
=
'funcaptcha'
website_key
=
None
website_url
=
None
sub_domain
=
None
def
__init__
(
self
,
website_key
,
website_url
,
sub_domain
=
None
):
super
(
FuncaptchaQuestion
,
self
)
.
__init__
(
self
.
type
,
website_key
=
website_key
,
website_url
=
website_url
,
sub_domain
=
sub_domain
)
class
BrowserHTTPNotFound
(
BrowserUnavailable
):
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment