drawrowfly / tiktok-scraper

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

collector for TikTokScraper() is empty #397

Closed fabnoe closed 3 years ago

fabnoe commented 3 years ago

Describe the bug TikTokScraper() return an empty collector

To Reproduce OS: Mac CLI or Module: Module Used method: hashtag nodejs v14.15.1 tiktok-scraper v1.4.6

-START ------------------
{
  headers: {
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4128.176 Safari/537.36',
    Referer: 'https://www.tiktok.com/',
    Cookie: 'tt_webid_v2=681373282902412072'
  },
  collector: []
}
-END------------------
router.get('/', function(req, res, next) {

  const TikTokScraper = require('tiktok-scraper');

  // Hashtag feed
  (async () => {
    try {
      const posts = await TikTokScraper.hashtag('winter', { number: 20 });
      console.log('-DONE ------------------');
      console.log(posts);
    } catch (error) {
      console.log('-ERROR ------------------');
      console.log(error);
    }
  })();

  res.render('index', { title: 'Express' });
});

Screenshots If applicable, add screenshots to help explain your problem.

drawrowfly commented 3 years ago

fixed in version @1.4.7