Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download user working from CLI but not from node #50

Closed
andycloke opened this issue Mar 28, 2020 · 8 comments
Closed

Download user working from CLI but not from node #50

andycloke opened this issue Mar 28, 2020 · 8 comments

Comments

@andycloke
Copy link

andycloke commented Mar 28, 2020

Firstly, thanks for all your awesome work on this!

I'm using the latest version (0.0.16), so I do not think it's a duplicate of this issue #44

CLI works just fine. e.g.

tiktok-scraper user USERNAME -n 20 -d -store

Using the node method returns 0 results (was previously working). Any ideas?

const posts = await TikTokScraper.user(USER_ID, {
      by_user_id: true,
      user_data: true,
      number: 10,
    });
@andycloke
Copy link
Author

Update - the node version does seem to work when using usernames, not user ids, e.g.

const posts = await TikTokScraper.user(USER_NAME, {
      user_data: true,
      number: 10,
    });

So maybe updating that just got missed in the 0.0.16 release?

@drawrowfly
Copy link
Owner

Regarding by_user_id
// Some TikTok user id's are larger then MAX_SAFE_INTEGER, you need to pass user id as a string

And it should work

Let me know

@drawrowfly
Copy link
Owner

Also new update is coming soon, with speed improvements and new features

@andycloke
Copy link
Author

andycloke commented Mar 28, 2020

@drawrowfly, unfortunately, I am already passing user_id as a string and it is not working. Can you try it on your side?

@drawrowfly
Copy link
Owner

I did and it worked well

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

(async () => {
    const posts = await TikTok.user('66654060363731107901', {
        by_user_id: true,
        user_data: true,
        number: 10,
    });
    console.log(posts);
})();

@andycloke
Copy link
Author

That's so strange. I tried that exact code and get { collector: [] }

@drawrowfly
Copy link
Owner

drawrowfly commented Mar 28, 2020

Ouch my bad, this is bad user id, try please with this one '6634543319555588102'

@andycloke
Copy link
Author

That one works, thanks, I think the issue is I was trying to scrape an account that has no been made private, so it doesn't return anything. I'll close the issue - thanks for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants