-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge(release/1.2.3): enable challenge solver video record optional
- Loading branch information
Showing
43 changed files
with
523 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '1.2.2' | ||
__version__ = '1.2.3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import falcon | ||
import six | ||
from monitorrent.settings_manager import SettingsManager | ||
from monitorrent.new_version_checker import NewVersionChecker | ||
|
||
|
||
# noinspection PyUnusedLocal | ||
class SettingsCloudflareChallengeSolver(object): | ||
def __init__(self, settings_manager): | ||
""" | ||
:type settings_manager: SettingsManager | ||
""" | ||
self.settings_manager = settings_manager | ||
|
||
def on_get(self, req, resp): | ||
resp.json = { | ||
'debug': self.settings_manager.cloudflare_challenge_solver_debug, | ||
'record_video': self.settings_manager.cloudflare_challenge_solver_record_video, | ||
'record_har': self.settings_manager.cloudflare_challenge_solver_record_har, | ||
'keep_records': self.settings_manager.cloudflare_challenge_solver_keep_records, | ||
} | ||
|
||
def on_patch(self, req, resp): | ||
if req.json is None or len(req.json) == 0: | ||
raise falcon.HTTPBadRequest('BodyRequired', 'Expecting not empty JSON body') | ||
|
||
debug = req.json.get('debug') | ||
if debug is not None and not isinstance(debug, bool): | ||
raise falcon.HTTPBadRequest('WrongValue', '"debug" have to be bool') | ||
|
||
record_video = req.json.get('record_video') | ||
if record_video is not None and not isinstance(record_video, bool): | ||
raise falcon.HTTPBadRequest('WrongValue', '"record_video" have to be bool') | ||
|
||
record_har = req.json.get('record_har') | ||
if record_har is not None and not isinstance(record_har, bool): | ||
raise falcon.HTTPBadRequest('WrongValue', '"record_har" have to be bool') | ||
|
||
keep_records = req.json.get('keep_records') | ||
if keep_records is not None and not isinstance(keep_records, int): | ||
raise falcon.HTTPBadRequest('WrongValue', '"keep_records" have to be int') | ||
|
||
if debug is not None: | ||
if self.settings_manager.cloudflare_challenge_solver_debug != debug: | ||
self.settings_manager.cloudflare_challenge_solver_debug = debug | ||
|
||
if record_video is not None: | ||
if self.settings_manager.cloudflare_challenge_solver_record_video != record_video: | ||
self.settings_manager.cloudflare_challenge_solver_record_video = record_video | ||
|
||
if record_har is not None: | ||
if self.settings_manager.cloudflare_challenge_solver_record_har != record_har: | ||
self.settings_manager.cloudflare_challenge_solver_record_har = record_har | ||
|
||
if keep_records is not None: | ||
if self.settings_manager.cloudflare_challenge_solver_keep_records != keep_records: | ||
self.settings_manager.cloudflare_challenge_solver_keep_records = keep_records | ||
|
||
resp.status = falcon.HTTP_NO_CONTENT |
Oops, something went wrong.