temtem Đăng vào 13-7-2020 23:48:35

Tải video không che watermark từ Douyin

Mạng xã hội Tiktok trung quốc ( đơn vị chủ quản là Bytes Dances ) rất cuốn hút giới trẻ khắp nơi trên thế giới sử dụng.
Dưới đây sẽ là một ứng dụng để giúp bạn tải video từ douyin về, với chất lượng file tốt nhất, không bị che logo tiktok.

<?php
header("Content-Type: text/html;charset=utf-8");
    if(isset($_GET["url"])){
      //HTTP headers setting
      $hdrs = array(
            'http' =>array('header' =>
             "Referer: https://v.douyin.com/" .
             "User-Agent: Mozilla/5.0 ABCD\r\n"
            ),
      );
      //Create requests
      $context = stream_context_create($hdrs);
      //Parse request get video id
      file_get_contents($_GET["url"],0,$context);
      $id=$http_response_header;
      $id=explode("video/",$id);
      $id=explode("/?",$id);
      $id=$id;
      //Get video data from api
      $url="https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids=".$id;
      $jsonData=file_get_contents($url,0,$context);
      $jsonData=json_decode($jsonData);
      //Get watermark play url
      $url=$jsonData->item_list->video->play_addr->url_list;
      //Get watermark video url
      $url=str_replace("playwm","play",$url);
      //Get non watermark video url
      file_get_contents($url,0,$context);
      for($i=0;$i<sizeof($http_response_header);$i++){
            $url=$http_response_header[$i];
            if(substr($url,0,8)=="location"){
                $url=$http_response_header[$i];
            break;
            }
      }

      $url=str_replace("location: ","",$url);
      echo $url;
    }

temtem Đăng vào 13-7-2020 23:54:44

Cách sử dụng:
Vào xem clip bạn thích, nhấn share, copy url, rồi dán vào form trang download:
https://tools.netdepviet.org/douyin/
hoặc điền vào sau link api sau:
https://tools.netdepviet.org/douyin/api.php?url=https://v.douyin.com/JFhcVoB/
Kết quả trả về là link clear, không watermark, bạn có thể tải về máy xem rồi.
Trang: [1]
Xem phiên bản đầy đủ: Tải video không che watermark từ Douyin