naseif / tiktok-scraper

Scraper for TikTok. Download videos, music, fetch users info and more.
https://naseif.github.io/tiktok-scraper/
MIT License
91 stars 24 forks source link

Issue with running fetchVideo(url) #24

Open khatiwadaaj opened 11 months ago

khatiwadaaj commented 11 months ago

TypeError: Cannot read properties of undefined (reading 'indexOf') at l.extractJSONObject (C:\My Files\mynodeserver\node_modules\tiktok-scraper-ts\dist\main.js:1:4

Doesn't even run the first time, anyone able to run this package?

lavanphat commented 10 months ago

Today, I got the same error as you. Did you fix this error ? @khatiwadaaj

khatiwadaaj commented 10 months ago

I gave up on this package and created my own custom solution.

lavanphat commented 10 months ago

I gave up on this package and created my own custom solution.

Can you send me your custom solution?

mayaYun0921 commented 8 months ago

@khatiwadaaj

Hello, I am a developer who needs a TikTok scraper. I also encountered the same error as this issue. Can you share how you solved it?

TypeError: Cannot read properties of undefined (reading 'indexOf')
at l.extractJSONObject 

I looked for it in your repository, but I couldn't find it. I would really appreciate your help.

sliptype commented 7 months ago

I'm also getting this on fetchUser

TypeError: Cannot read properties of undefined (reading 'indexOf')
    at m.extractJSONObject (/home/node/app/node_modules/tiktok-scraper-ts/dist/main.js:1:2914)
    at m.requestWithPuppeteer (/home/node/app/node_modules/tiktok-scraper-ts/dist/main.js:1:3335)
    at async m.TryFetch (/home/node/app/node_modules/tiktok-scraper-ts/dist/main.js:1:3677)
    at async m.user (/home/node/app/node_modules/tiktok-scraper-ts/dist/main.js:1:4623)

It seems that <script id="SIGI_STATE" type="application/json"> no longer exists in the response from tiktok. Perhaps tiktok-scraper-ts needs to be updated to use <script id="__UNIVERSAL_DATA_FOR_REHYDRATION__" type="application/json"> instead? cc @naseif