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

[QUESTION] - How many requests we can do per second? #30

Open
lucasoares opened this issue Dec 2, 2020 · 6 comments
Open

[QUESTION] - How many requests we can do per second? #30

lucasoares opened this issue Dec 2, 2020 · 6 comments
Labels
question Further information is requested

Comments

@lucasoares
Copy link

Hello.

After november and with CAPTCHA implementation my cookie verifyFp gets blocked and I have to change it or create a new one accessing the browser directly.

Did you ever tried to find out how many user_posts requests (for example) you can do before being blocked? Are you manually getting new cookie each time you are blocked?

Thanks

@favstats
Copy link
Collaborator

favstats commented Dec 2, 2020

Hi Lucas!

Have you tried waiting for a little or do you know for certain that your cookie is permanently blocked?

I've been using the same cookie the last couple of days without having to change it. My requests do occasionally get blocked but I just error handle them and try again in a few minutes, has worked for me without problems.

@hidayaa
Copy link

hidayaa commented Dec 3, 2020

@RohanAlexander and I are wondering if you would mind letting me know what it looks like when you 'get blocked' - we'd just like to confirm that this is the issue and nothing else. Does it look like this?

image

Some background info, this seems to be a unique issue, all the other functions that I have tested out works (i.e user_posts &trends). I double check the issue by getting a new cookie & the code still does not run. I got a new cookie and it does not seem to be solving the problem.

Thanks :)

@benjaminguinaudeau
Copy link
Owner

benjaminguinaudeau commented Dec 3, 2020

Hi,

This is one big issue with working on unofficial API. If the request is badly specified (for instance, wrong user agent), you get an empty body. If the request is actually blocked, you normally get a statusCode == 10000 (higher than 1000 if the query parameter is wrong, like a nonexisting user).

As background info, this is the response that triggers the error

if(content == "{\n    statusCode: -1,\n    itemInfo: {}\n} "){
    stop("empty response : request was blocked by tiktok")
    content <- "{}"
  }

I've been working on improving the error messages in the dev branch. Feel free to install this version, which may give you more accurate information about the error message.

The current dev version does not reproduce the error (see screenshot)
Screenshot 2020-12-03 at 16 28 41

@favstats favstats added the question Further information is requested label Dec 4, 2020
@hidayaa
Copy link

hidayaa commented Dec 8, 2020

Hi Benjamin,

Sorry for the late response. I tried the dplyr::gplimpse method you sent me but I'm still getting the error.

See images below.

Code:
image

Output:
image

Thanks in advance :)

@benjaminguinaudeau
Copy link
Owner

Hi,

Sorry for the misunderstanding. dplyr::glimpse() only print a dataframe in a light way.

In the meantime, we've merged the dev branch into the main. So, simply try to reinstall the package and let me know if that works.

@hidayaa
Copy link

hidayaa commented Dec 8, 2020

Hey,

I reinstalled and still no luck. I'm using a Mac if should that make a difference?

Thanks for your help on this! Much appreciated!

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

No branches or pull requests

4 participants