PHP code example of zyan / douyin-music

1. Go to this page and download the library: Download zyan/douyin-music 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/ */

    

zyan / douyin-music example snippets


use Zyan\DouyinMusic\DouyinMusic;

//抖音
$music = DouyinMusic::get('https://v.Douyin.com/eeYy4Yo/');


$music->getData();

/*
Array
(
    [music] => https://sf3-cdn-tos.douyinstatic.com/obj/ies-music/7020997451465214728.mp3
    [img] => https://p3.douyinpic.com/aweme/1080x1080/aweme-avatar/tos-cn-avt-0015_a919f61807c59ed80652227436267782.jpeg?from=116350172
    [thumb] => https://p26.douyinpic.com/img/aweme-avatar/tos-cn-avt-0015_a919f61807c59ed80652227436267782~c5_168x168.jpeg?from=116350172
    [title] => @Scenery 阿健创作的原声一Scenery 阿健(原声中的歌曲:Birds Chatting Calmly-Silent Knights)
    [author] => Scenery 阿健
)
*/

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

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

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

//获取作者
$music->getAuthor();

//获取音乐缩略图
$music->getThumb();