RobertGrubb / tiktok-php

TikTok scraper in PHP
MIT License
63 stars 21 forks source link

User data not getting #37

Closed andersonrobert1313 closed 3 years ago

andersonrobert1313 commented 3 years ago

when try to get user data error : Array ( [error] => 1 [message] => Unable to retrieve NEXT_DATA from DOM )

RobertGrubb commented 3 years ago

This is due to the captcha verification coming back as a response. Right now, there's not a solid solution for this, so what I'll be doing is pushing an update that allows you to manually set the verifyFp token. Stay tuned.

SlavaPWNZ commented 3 years ago

This is due to the captcha verification coming back as a response. Right now, there's not a solid solution for this, so what I'll be doing is pushing an update that allows you to manually set the verifyFp token. Stay tuned.

Hey Robert! I often get code 10000 or error 'Verification for current cookie data is required'. It also looks like captcha...

yasirrose commented 3 years ago

When I hit any file like video.php, music.php, or any other file to get data I am also facing such type of sam error in the response. Please have a look at the screenshot. image

andersonrobert1313 commented 3 years ago

Hey @RobertGrubb when can you push the new updates ? i am using your library on my live site and my customers are complaining. can you provide the stable version. Thanks

RobertGrubb commented 3 years ago

@andersonrobert1313

As of v1.9.12 you may now manually set a fp token that you have verified via captcha from tiktok's website like so:

$scraper = new Scraper([
  'verifyFp' => 'verify_xxxxxx_xxx...'
]);

As soon as it's possible, I will implement a captcha solver. Just not sure about the route I want to take with it yet.

RobertGrubb commented 3 years ago

Closing due to no response. Feel free to reopen if need be.

andersonrobert1313 commented 3 years ago

Hey @RobertGrubb This is not the solution i can't tell to all my customers for go to tiktok website and add the manually token. Do you have any other solution for this.

RobertGrubb commented 3 years ago

Hey @RobertGrubb This is not the solution i can't tell to all my customers for go to tiktok website and add the manually token. Do you have any other solution for this.

I'm not sure what your setup is. If you're saying that you spin up a new scraper for every customer, then yes, this is the actual solution right now.

If you are scraping FOR your customers, only you should be setting the fp token on your scraper configuration.

andersonrobert1313 commented 3 years ago

Hey @RobertGrubb

I am using your library on shopify app. So all my customers are using my app on their store. So each store has their own username and own platform to use your apis.

So in my app there is an input field by saying enter tiktok username.

Once they add username then I'll hit your apis and fetch last 20 videos. From those videos customer can on/off what to show or hide on their website.

Now can you let me know how can I continue with your apis.

Thanks

On Sat, 21 Nov 2020 at 6:57 PM, Robert Grubb notifications@github.com wrote:

Hey @RobertGrubb https://github.com/RobertGrubb This is not the solution i can't tell to all my customers for go to tiktok website and add the manually token. Do you have any other solution for this.

I'm not sure what your setup is. If you're saying that you spin up a new scraper for every customer, then yes, this is the actual solution right now.

If you are scraping FOR your customers, only you should be setting the fp token on your scraper configuration.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RobertGrubb/tiktok-php/issues/37#issuecomment-731579485, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOMVU2TEJFIJEKMRHZ5FYLDSQ653HANCNFSM4TVJYPNQ .

findtvseries commented 3 years ago

Tiktok / Libraries / Request.php Line 309 " if (preg_match_all('#\<script id=\"NEXT_DATA\" type=\"application/json\" crossorigin=\"anonymous\">(.*?)\<\/script>#', $this->data, $out)) { return json_decode($out[1][0], true, 512, JSON_BIGINT_AS_STRING); } " change code " if (preg_match_all('#\<script id=\"NEXT_DATA\" type=\"application/json\" nonce="(.?)" crossorigin=\"anonymous\">(.?)\<\/script>#', $this->data, $out)) {

  return json_decode($out[2][0], true, 512, JSON_BIGINT_AS_STRING);
}

" Tadadadam