drawrowfly / tiktok-scraper

TikTok Scraper. Download video posts, collect user/trend/hashtag/music feed metadata, sign URL and etc.
4.44k stars 805 forks source link

userEvent not Working ? #749

Closed XeraFiu-YTB closed 2 years ago

XeraFiu-YTB commented 2 years ago

Hi, i want to get the new video posted by an account. For this i'm using the userEvent but there isn't any documentation on it, the number : 30 refert to ?

    const users = TiktokScraper.userEvent("xerafiu", { number: 30})

    users.on('data', json => {
        console.log(json)
    })
    users.on('done', () => {
        console.log("Done")
    });
    users.on('error', error => {
        console.log("Erreur Tiktok Event")
    });
    users.scrape()

This code will give me "Done" in the console, but when i'm uploading a video, the users.on("data") isn't executed.

Any idea ?