mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 18:53:21 +01:00
[cloudflare] fix bypass procedure
Cloudflare challenges, at least for kissmanga and readcomiconline, now use slightly different Javascript expressions. Instead of a single value per expression, they now have a numerator and a denominator of a fractional value, which in the end gets truncated to 10 decimal places.
This commit is contained in:
parent
759ba26fb0
commit
f6c95dccf9
@ -61,11 +61,18 @@ def solve_jschl(url, page):
|
||||
value = evaluate_expression(expr[vlength+2:])
|
||||
solution = func(solution, value)
|
||||
elif expr.startswith("a.value"):
|
||||
return solution + len(urllib.parse.urlsplit(url).netloc)
|
||||
solution += len(urllib.parse.urlsplit(url).netloc)
|
||||
if ".toFixed(" in expr:
|
||||
solution = "{:.10f}".format(solution)
|
||||
return solution
|
||||
|
||||
|
||||
def evaluate_expression(expr):
|
||||
"""Evaluate a Javascript expression for the challenge"""
|
||||
if "/" in expr:
|
||||
num, _, denom = expr.partition("/")
|
||||
return evaluate_expression(num) / evaluate_expression(denom)
|
||||
|
||||
stack = []
|
||||
ranges = []
|
||||
value = ""
|
||||
|
Loading…
Reference in New Issue
Block a user