pablouser1 / TikScraperPHP

Wrapper for TikTok API
https://packagist.org/packages/pablouser1/tikscraper
MIT License
66 stars 20 forks source link

Comment implementation Working #8

Open Spawnrad opened 2 years ago

Spawnrad commented 2 years ago

Hi @pablouser1,

Here a quick implementation for working comments:

    public function comments(int $cursor = 0) {
        $this->cursor = $cursor;
        $query = [
            'aweme_id' =>  $this->term,
            'count' =>  '20',
            'cursor'=> $this->cursor,
        ];
        $req = $this->sender->sendApi('/api/comment/list/', 'www', $query);
        dd($req);
    }

We need to change the header referer otherwise it doesn't work Add '/' at the end make it work i didn't know why lol

class Sender {
    private const REFERER = 'https://www.tiktok.com/';

Hope that can help you.

brucekasinsky commented 1 year ago

Hello @Spawnrad , what sign you use, because my sign is not working

[meta] => TikScraper\Models\Meta Object ( [success] => [http_code] => 200 [tiktok_code] => -1 [tiktok_msg] => UNKNOWN_ERROR )

Spawnrad commented 1 year ago

Hi @brucekasinsky,

sorry didn't saw your message. Im using signtok and it work very well.