1

i am using two function for get the url or video play 1. for extract the tiktok for video with watermark

public function getDetails()
{
    $url = $this->url;
    $resp = $this->getContent($url);
    $check = explode("\"contentUrl\":\"", $resp);
    if (count($check) > 1) {
        $video = explode("\"", $check[1])[0];
        $videoWithoutWaterMark = $this->WithoutWatermark($url);
        $thumb = explode("\"", explode("\"thumbnailUrl\":[\"", $resp)[1])[0];
        $username = explode("/", explode("@", explode("\"", explode("\"url\":\"", $resp)[1])[0])[1])[0];

        $result = [
            'video'=>$video,
            'withoutWaterMark'=>$videoWithoutWaterMark,
            'user'=>$username,
            'thumb'=>$thumb,
            'error'=>false,
            'message'=>false
        ];
    }
    else
    {
        $result = [
            'video'=>false,
            'withoutWaterMark'=>false,
            'user'=>false,
            'thumb'=>false,
            'error'=>true,
            'message'=>"Please double check your url and try again."
        ];
    }

    return $result;

}


private function cUrl($url)
{
    $user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    $result = curl_exec($ch);
    curl_close($ch);
    return $result;

}

and another function for get the video url without water mark is

private function WithoutWatermark($url)
{
    //videi id for example 6795008547961752326
    $dd = explode("video/",$url);
    $url = "https://api2.musical.ly/aweme/v1/playwm/?video_id=".$dd[1];
    return $url;
}

Please help me to find tiktok video id, or any way to create download link of video without watermark. how can i find the video id of the video so i will use this video id for create a download link " https://api2.musical.ly/aweme/v1/playwm/?video_id=v09044b90000bpfdj5q91d8vtcnie6o0";

Progman
  • 16,827
  • 6
  • 33
  • 48

1 Answers1

1

Your function WithoutWatermark doesn't work.

If you have an url like: tiktok.com/@user/video/123456

then you can make a curl:

$data = cUrl($url)

You'll get a page from tiktok, with regex you can extract url video:

https://v16.muscdn.com/123etc

Then again curl with this above url, the response is bytes and inside with regex you can find something like this vid:yourvideoid

em294
  • 58
  • 1
  • 2
  • 5
  • hello old video link "https://api2.musical.ly/aweme/v1/playwm/?video_id=123456" not working or may be it is suspended, can you tell me how can i get new video link for without watermark video, please help me – krishna technosoft Jun 19 '20 at 16:48
  • 1
    New link is https://api.tiktokv.com/aweme/v1/playwm/?video_id=1234 – em294 Jun 20 '20 at 09:08
  • thanks its working, can you please help me on another issue, this url redirect to an another url, i want to download video from just one click, how can i download video directly from this url? The video is from TikTok. When you go to the url, it instantly redirects you to another url. The other url is the one I want in order to save the video. However, the url it directs you to does not have a "view html source" option. I can inspect the element and that shows it has a video tag, but I cannot find a way to save the url between the tag. I am using php and html. Help Please – krishna technosoft Jun 20 '20 at 12:06
  • The https://api.tiktokv.com/aweme/v1/playwm/?video_id={video_string_id} seems to be redirecting to watermarked video. Any help ? – John Deep Aug 06 '20 at 14:43
  • Try with something like this: https://api.tiktokv.com/aweme/v1/playwm/?video_id=vtiktokvideoid&line=0&ratio=default&media_type=4&vr_type=0 – em294 Aug 06 '20 at 18:32
  • 2
    hi @em294. With new videos. How can we finger out the secret id? – Carson Vo Aug 29 '20 at 11:16