-
Notifications
You must be signed in to change notification settings - Fork 7
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
[ Windows ] empty response ; something was probably wrong with the request #24
Comments
Hi Diego, I'm sorry that you are experiencing this problem and thanks for sharing it. Here are a couple of questions to help me identify the problem. Can you please confirm that you run the following lines? tk_init()
tk_auth(cookie= "the cookie you get from tiktok.com")
Can you try with other endpoints and tell me if you experience the same errors? user <- tk_info(scope = "user", query = "willsmith")
hashtag <- tk_info(scope = "hashtag", query = "maincharacter")
user_post <- tk_posts(scope = "user", query = "willsmith", n = 40)
hashtag <- tk_posts(scope = "hashtag", query = "maincharacter", n = 25)
Finally, it would help if you could print the output of Thank you! |
I was testing with the code you sent me, but I keep having the same problem. I had previously included the tk_init and the tk_auth, just as you said. However, when I test with Will Smith, only one post comes out. I attach the session info.
` Packages ----------------------------------------------------------------------------------- [1] C:/Users/Diego Alejandro/Documents/R/win-library/4.0
|
Alright. Here are a few more diagnostics: get_signature("test") # you should get a string as result starting with "test&_signature=_" and followed by a very long token
verify <- get_current_verify() # you should get a string starting with "verify_" followed by a long token
url <- glue::glue("https://m.tiktok.com/api/item_list/?aid=1988&id=6727327145951183878&secUid=MS4wLjABAAAA8ezUaW4ecJX222ObGXxt07F9BIh4QH3-g1P1DHyChT2LLi2cn-vAE2R53-H672ZO&count=50&maxCursor=0&minCursor=0&sourceType=8&verifyFp={get_current_verify()}&user_agent=Mozilla%2F5.0+(Macintosh%3B+Intel+Mac+OS+X+10_14_7)+AppleWebKit%2F537.36+(KHTML,+like+Gecko)+Chrome%2F86.0.4240.198+Safari%2F537.36")
out <- get_data(url, parse = T)
|
I already tried that code, and it returns only a post from the user that I am trying to collect data. And this is what appears to me. `get_signature("test")
|
The issue seems to come from running puppeteer on windows. A friend could reproduce it on a windows computer. I will look into it tomorrow and will hopefully find a quick fix. Sorry for this... |
No do not worry. I really appreciate your help and time, it is important to me. I'll be waiting for your responses tomorrow, and thanks for creating the package. |
Hier is some update. I know where the issue is, but I don't know how to fix this. It's happening in a python script that runs in the background and which is shared with the python tiktok-api. When trying to run the python API, I observe the exact same problem. I'm working on an alternative way based on docker, but this will take a couple of days before being operational. Stay tuned; I'll update you as soon as I have something working on windows. |
Good morning, Benjamin. I am very sorry I did not answer you before, but I had several pending activities. First of all, I want to thank you very much for the time you have taken to help me solve the problem. Second, I'll be on the lookout for any progress you've made. Thanks for everything. |
Hello, I have the same problem exactly, but also on MacOs, I mean, I tried both OS and MacOs also returned me that problem Many thanks!!! |
Does |
sorry, I check again on MacOs and now is running well. On windows the same problem with the answer |
Can you please start another issue, because the problem of Diego is specific to windows? I'll help you there |
Dieog, I'm still working on a solution for windows. I've made it worked on a friends' computer ; I'm now adapting tiktokr. Thank you for your patience again. |
Thank you so much, Benjamin. Dont worry, I wait. |
Hi Diego, We've pushed an update which works on windows computer now. You'll need to install docker though. More info here: https://github.com/benjaminguinaudeau/tiktokr#using-tiktokr-with-docker This is kind of experimental and hard to test, because I don't have any windows computer ; so feel free to shared any issue here, which could help us to improve the code |
Hi, Benjamin. Thanks a lot for all your help, I am very grateful. Note that initially the code served me and I was able to extract data from Will Smith, but then, when I tried with another account, it gives me this error from Docker.
|
And when I give tk_auth (docker = TRUE) I get the following message:
But then happen this:
Usage: docker build [OPTIONS] PATH | URL | - Build an image from a Dockerfile
|
Thank you for your patience! This is good feedback and very helpful to observe these errors. The docker container cannot build for some reason. All other errors come from that point ; I'll build a trigger to make sure the code breaks if the image is not built. Can you run |
I already tried, Benjamin, but I get the following message. I ran the script in the R Studio console.
|
I dont know if the problem will be Docker because I didnt have any container created. |
I send you my screenshot. |
This looks good. |
Ok. no container were created. I suspect something went run while building the image of the container. Can you run the following chunk: folder <- tempfile()
git2r::clone("https://github.com/benjaminguinaudeau/tiktok_signature.git", local_path = folder)
system(glue::glue("docker build {folder} -t tiktoksignature")) |
Ok: Can you please try: system(glue::glue("docker build -t tiktoksignature {folder}")) |
What does your folder variable look like? Is there any space in the path that should be escaped? |
Yes, the spece between 'Diego' and 'Alejandro' must be escaped. You should do: system(glue::glue("docker build -t tiktoksignature '{folder}'"))
|
reupdated (sorry, this an issue with the path and I'm not familiar with how to escape path in windows) |
Ok, I still appreciate all the help and support you gave me. Too bad it couldn't be fixed. |
I'll look into it tomorrow and try this specific case with spaces in paths. If I get a fix, I'll let you know. |
Hi Diego, system(glue::glue('docker build "{normalizePath(folder)}" -t tiktoksignature')) Let me know about the result if you give it a try. |
Good night, Benjamin. I'm sorry it took me so long to answer, but I have been to several activities. Notice that I tried to use the command, but it didn't work for me. I don't know if Docker is the problem, but no problem. I want to ask you if you know how to extract data from Facebook as well. |
trends <- tk_posts(scope = "trends", n = 200)
! [2020-11-23 20:38:19] t- (not found)
Warning message:
In get_data(url, parse = T, ...) :
empty response ; something was probably wrong with the request
The text was updated successfully, but these errors were encountered: