From 4da5bd739a1c0c118b72ba4478f8430fb78efd98 Mon Sep 17 00:00:00 2001 From: Tufayel Ahmed <39314838+TufayelLUS@users.noreply.github.com> Date: Thu, 27 Aug 2020 22:21:24 +0600 Subject: [PATCH] Applied a fix on watermark free API I found that the user agent matters when you access an API. I changed it and somehow it is working now! Cheers! --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index e4bb11d..3b9d06f 100644 --- a/index.php +++ b/index.php @@ -8,7 +8,7 @@ function getContent($url, $geturl = false) CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false, CURLOPT_FOLLOWLOCATION => true, - CURLOPT_USERAGENT => 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0', + CURLOPT_USERAGENT => 'okhttp', CURLOPT_ENCODING => "utf-8", CURLOPT_AUTOREFERER => true, CURLOPT_CONNECTTIMEOUT => 30, @@ -131,7 +131,7 @@ function getContent($url, $geturl = false) $thumb = explode("\"",explode('og:image" content="', $resp)[1])[0]; $username = explode("/",explode("@",explode("\"",explode("\"canonicalHref\":\"", $resp)[1])[0])[1])[0]; $videoKey = getKey($contentURL); - $cleanVideo = "https://api.tiktokv.com/aweme/v1/playwm/?video_id=$videoKey&line=0&ratio=default&media_type=4&vr_type=0"; + $cleanVideo = "https://api2-16-h2.musical.ly/aweme/v1/play/?video_id=$videoKey&vr_type=0&is_play_url=1&source=PackSourceEnum_PUBLISH&media_type=4"; $cleanVideo = getContent($cleanVideo, true); ?>