https://site.com/example/то тоже норм.
<?php
header('Access-Control-Allow-Methods: POST');
header('Access-Control-Allow-Headers: Content-Type');
$answer = array(
"error" => 1
);
if(is_array(($obj = json_decode(urldecode(file_get_contents('php://input')), true))) && json_last_error() == JSON_ERROR_NONE){
$answer['error'] = 0;0
}
else{
$answer['error'] = 'WRONG_REQUEST';
$answer['Description'] = 'The request must contain json';
}
echo json_encode($answer);
?>
import random
import time
def f(coords, time_movie, steps):
x_a = []
y_a = []
now = int(time.time() * 1000)
timestamp = sorted([random.randint(now, now + time_movie * 1000) for _ in range((steps * len(coords) - 1) + 1)])
for i in range(len(coords) - 1):
x1, y1, x2, y2 = *coords[i], *coords[i + 1]
x_steps = sorted([random.randint(min(x1, x2), max(x1, x2)) for _ in range(steps)], reverse=(x1 > x2))
y_steps = sorted([random.randint(min(y1, y2), max(y1, y2)) for _ in range(steps)], reverse=(x1 > x2))
x_a.extend([x1] + x_steps + [x2])
y_a.extend([y1] + y_steps + [y2])
return [[x, y_a[index], timestamp[index]] for index, x in enumerate(x_a)]
coords = [[392, 556], [95, 309], [207, 192]]
step_res = f(coords, 2, 30)
print(step_res)
Но браузер запущенный с помощью Playwright практически не дает работать руками (страницы не грузяться)