PHP code example of php127 / douyin

1. Go to this page and download the library: Download php127/douyin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

php127 / douyin example snippets


use Php127\Douyin\Factory;;

//抖音
$app = Factory::douyin('https://v.Douyin.com/eeYy4Yo/');

//快手
$app = Factory::kuaishou('https://v.kuaishou.com/gcNIRW');

$app->getData();

/*
Array
(
    [title] => “如果风会说话,不知道他会不会告诉你,我一直在想你”#三月你好
    [url] => https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0d00ff90000c0u6h388f47ar50b7ssg&ratio=720p&line=0
    [img] => https://p29.Douyinpic.com/tos-cn-p-0015/dab756097b094853bbffb9b744aa246a_1614571698~tplv-dy-360p.jpeg?from=2563711402
    [music] => https://sf6-cdn-tos.Douyinstatic.com/obj/ies-music/6934532600002284296.mp3
)
*/

//获取title
$app->getTitle();

//获取img
$app->getImg();

//获取music
$app->getMusic();

//获取无水印url
$app->getUrl();

//获取图文类型中的图片
$app->getImages();


$app->setUrl(string $url = 'https://v.Douyin.com/eeYy4Yo/');
$app->getData();
//...