mirror of
https://github.com/morpheus65535/bazarr
synced 2025-02-01 12:08:13 +00:00
cb420628f8
* Upgraded cloudscraper to fix multiple issues with providers that uses antibot page. * Fixed subs4series provider. It now require anti-captcha provider to download subtitles. One captcha will have to be solved for each download. #1442
33 lines
972 B
Python
33 lines
972 B
Python
from __future__ import absolute_import
|
|
|
|
import sys
|
|
|
|
try:
|
|
import v8eval
|
|
except ImportError:
|
|
sys.tracebacklimit = 0
|
|
raise RuntimeError('Please install the python module v8eval either via pip or download it from https://github.com/sony/v8eval')
|
|
|
|
from . import JavaScriptInterpreter
|
|
from .encapsulated import template
|
|
|
|
# ------------------------------------------------------------------------------- #
|
|
|
|
|
|
class ChallengeInterpreter(JavaScriptInterpreter):
|
|
|
|
def __init__(self):
|
|
super(ChallengeInterpreter, self).__init__('v8')
|
|
|
|
# ------------------------------------------------------------------------------- #
|
|
|
|
def eval(self, body, domain):
|
|
try:
|
|
return v8eval.V8().eval(template(body, domain))
|
|
except (TypeError, v8eval.V8Error):
|
|
RuntimeError('We encountered an error running the V8 Engine.')
|
|
|
|
|
|
# ------------------------------------------------------------------------------- #
|
|
|
|
ChallengeInterpreter()
|