From 46acd692e373b5a5c69f8a6c06a0dfae5e834773 Mon Sep 17 00:00:00 2001 From: Tobi Saputra Date: Sat, 7 Dec 2024 23:49:11 +0700 Subject: [PATCH] docs: add tiktok get comments documentation --- README.md | 82 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 72 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7222822..229eb26 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,25 @@
- - - - + + + + + + + + + + + + +

- + + +

@@ -88,11 +99,11 @@ npm install github:TobyG74/tiktok-api-dl # Examples -## Tiktok Downloader +## Tiktok Downloader By URL - V1 uses the API from TiktokAPI - Support Video, Images / Slide, Music -- ## V2 uses the API from [SSSTik](https://ssstik.io/) +- V2 uses the API from [SSSTik](https://ssstik.io/) - V3 uses the API from [MusicalDown](https://musicaldown.com/) ### Options @@ -102,15 +113,17 @@ npm install github:TobyG74/tiktok-api-dl - `v2` : SSSTik - `v3` : MusicalDown - `proxy` : Proxy for request +- `showOriginalResponse` : Show original response from API && Only for V1 ```js const Tiktok = require("@tobyg74/tiktok-api-dl") -const tiktok_url = "https://vt.tiktok.com/ZS84BnrU9" +const tiktok_url = "https://vt.tiktok.com/xxxxxxxx" Tiktok.Downloader(tiktok_url, { version: "v1", // version: "v1" | "v2" | "v3" proxy: "YOUR_PROXY" // Support Proxy Http, Https, Socks5 + showOriginalResponse: true // Only for V1 }).then((result) => { console.log(result) }) @@ -146,7 +159,7 @@ Tiktok.Search(username, { }) ``` -## Tiktok Stalker +## Tiktok Get Profile By Username ### Options @@ -168,6 +181,26 @@ Tiktok.StalkUser(username, { }) ``` +## Tiktok Get Comments From Video + +### Options + +- `postLimit` : Limit the number of posts to display +- `proxy` : Proxy for request + +```js +const Tiktok = require("@tobyg74/tiktok-api-dl") + +const url = "https://vt.tiktok.com/xxxxxxxx" + +Tiktok.GetComments(url, { + commentLimit: 20, // Limit the number of comments to display + proxy: "YOUR_PROXY" // Support Proxy Http, Https, Socks5 +}).then((result) => { + console.log(result) +}) +``` + ## Response
@@ -184,6 +217,7 @@ Tiktok.StalkUser(username, { id: string createTime: number description: string + isTurnOffComment: boolean isADS: boolean hashtag: string[] author: { @@ -236,6 +270,7 @@ Tiktok.StalkUser(username, { isAuthorArtist: boolean } } + resultNotParsed?: any } ``` @@ -359,7 +394,7 @@ Tiktok.StalkUser(username, {
- Tiktok Stalker + Tiktok Get Profile
```ts @@ -384,6 +419,33 @@ Tiktok.StalkUser(username, { } posts: Posts[] } + totalPosts: number +} +``` + +
+
+ Tiktok Get Comments +
+ +```ts +{ + status: "success" | "error" + message?: string + result?: [{ + cid: string + text: string + commentLanguage: string + createTime: number + likeCount: number + isAuthorLiked: boolean + isCommentTranslatable: boolean + replyCommentTotal: number + replyComment: [] + user: User + url: string + }], + totalComments: number } ```