Code php tim tiktok
<?php
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');
$link = $_GET['link'] ?? '';
if (empty($link) || !str_contains($link, 'tiktok.com')) {
echo json_encode([
'status' => 'error',
'msg' => 'Vui lòng nhập link TikTok hợp lệ! (ví dụ: https://vt.tiktok.com/xxxx hoặc https://www.tiktok.com/@user/video/xxxx)'
]);
exit;
}
// Cấu hình giống hệt curl bạn gửi
$token = '5d01ce40835246daa138f6ee4cc0b03e'; // token TikTok từ curl của bạn
$quantity = 100; // mặc định 100 likes (như ví dụ bạn gửi)
$postData = http_build_query([
'token' => $token,
'timezone_offset' => 'Asia/Saigon', // hoặc Asia/Bangkok cũng được
'timezone_offset_2' => 'abcd',
'free_link' => $link,
'quantity' => $quantity
]);
$ch = curl_init('https://leofame.com/free-tiktok-likes?api=1');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Mobile Safari/537.36');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/x-www-form-urlencoded',
'Origin: https://leofame.com',
'Referer: https://leofame.com/free-tiktok-likes'
]);
// Cookie (chủ yếu là token)
curl_setopt($ch, CURLOPT_COOKIE, 'token=' . $token);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode == 200 && $response) {
// Kiểm tra phản hồi từ leofame
if (strpos($response, 'success') !== false strpos($response, 'buff') !== false strpos($response, 'added') !== false) {
echo json_encode([
'status' => 'success',
'msg' => '✅ Đã gửi yêu cầu buff TikTok Likes thành công!',
'link' => $link,
'quantity' => $quantity,
'note' => 'Likes sẽ tăng dần. Mỗi link chỉ được buff 1 lần mỗi 24 giờ.'
]);
} else {
echo json_encode([
'status' => 'cooldown',
'msg' => '⚠️ Link này đã được buff trong 24 giờ qua. Vui lòng thử lại sau!'
]);
}
} else {
echo json_encode([
'status' => 'error',
'msg' => '❌ Không thể kết nối với Leofame. Hãy thử lại sau ít phút.'
]);
}
?>
❤1