GithubHelp home page GithubHelp logo

18576778091 / tiktokspider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from meetmr/tiktokspider

0.0 0.0 0.0 26 KB

Tiktok 采集,支持获取Tiktok用户个人信息,获取用户所有发布视频、视频评论、视频下载等

License: GNU General Public License v3.0

JavaScript 0.46% PHP 99.54%

tiktokspider's Introduction

介绍

Tiktok 采集库,支持采集Tiktok用户、视频信息等,使用php开发,本项目依赖xbogus,项目文件已经包含,请使用nodejs

使用时,请修改TiktokSpider.php 文件中的

    private $cmdRoot = "node D:\mycode\\xbogus\index.js \"%s\"";

特征

  • 支持采集抖音用户基本信息
  • 支持采集抖音用户所有发布视频
  • 支持获取视频基本信息
  • 支持采集视频所有评论
  • 支持下载视频
  • 支持搜索关键词采集

demo

1、获取抖音用户基本信息

$tiktok = new TiktokSpider('', '', '', [
    "ip" => "127.0.0.1:49881"
]);
$data = $tiktok->debug()->getUserInfo("cnn");
print_r($data);

2、采集用户所有发布视频

$tiktok = new TiktokSpider('', '', '', [
    "ip" => "127.0.0.1:49881"
]);
$data = $tiktok->getUserItemList(new GetListItemOptions("cnn","",20,0,1));
print_r($data);

3、采集视频所有评论

$data = (new TiktokSpider("","","",[
    "ip" => "127.0.0.1:49881"
]))->getVideoComments((new GetVideoCommentOptions("7315171634346741038",20,0,1)));
print_r($data);

4、获取视频基本信息

$data = (new TiktokSpider($cookie,"","",[
    "ip" => "127.0.0.1:49881"
]))->debug()->getVideoDetail($url);
dd($data);

5、下载视频

下载视频必须需要Tiktok的cookie

$spider = new  TiktokSpider($cookie,"","",[
    "ip" => "127.0.0.1:49881"
]);

$data = $spider->debug()->downloadVideo($url);
file_put_contents("1.mp4",$data['data']);

6、搜索

下载视频必须需要Tiktok的cookie、token

$tiktok = new TiktokSpider($cookie,   $token, '', [
    "ip" => "127.0.0.1:49881"
]);
$data = $tiktok->search(new SearchOptions("搞笑",20,0,1));
dd($data);

tiktokspider's People

Contributors

meetmr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.