tiktok-scraper icon indicating copy to clipboard operation
tiktok-scraper copied to clipboard

0 posts in collector

Open AyQWERTY opened this issue 3 years ago • 97 comments

Describe the bug In my project, I collect basic profile information (subscribers, likes) and in each video views, comments and shares. My project is used for myself, so the number of requests is small, about 15 profileInfo, and 15 user(about 35 posts on account) requests per hour.

After half a day or a day, the scraper begins to scraping 0 posts. I tried running the script on two VPS (different IPs), and both after that time stopped collecting posts(collector.length = 0). I tried putting a breakpoint in the place where tiktok-scraper receives response, to see what it receives and if it receives anything at all. And yes it does, but it's a response with no body, just head, scripts and stuff(If you need, I can send you response).

To Reproduce Just try to get user info throughout the day.

Info (VPS#1 | VPS#2)

  • Used OS: Linux 4.4.180+ | Linux 4.9.0-16-amd64
  • NodeJs Version: v14.16.0 | v14.17.5
  • Scraper Version: 1.4.36 both
  • CLI or Module: Module
  • Used method: user Promise
  • Used options: number: 1000, sessionList: [x1 sid_tt]
  • Do you run the scraper through Proxy, VPN, VPS?: proxy/vpn - no, but I tried it through a proxy and it had no effect, still 0 posts
  • If scraping from a profile. Did you checked if profile is Public?: yes, its public

AyQWERTY avatar Sep 01 '21 14:09 AyQWERTY

I'm experiencing errors around getting videos and user metadata, too. I run through a proxy. We use both the CLI and Module.

DanKaplanSES avatar Sep 01 '21 16:09 DanKaplanSES

Seeing this too

rileymiller avatar Sep 01 '21 23:09 rileymiller

I'm experiencing errors around getting user metadata, too

BK-Go-Python avatar Sep 02 '21 08:09 BK-Go-Python

I was getting 0 data back, even after setting --session sid_tt=MY_SID_TT but I turned on NordVPN in "obfuscated" mode (which is supposed to avoid looking like a VPN) and it's flowing now

boscacci avatar Sep 02 '21 16:09 boscacci

I was getting 0 data back, even after setting --session sid_tt=MY_SID_TT but I turned on NordVPN in "obfuscated" mode (which is supposed to avoid looking like a VPN) and it's flowing now

As a temporary solution, of course, not bad, but setting up somehow VPN on VPS which also hosts various websites, I think, would be a bad idea 😁

AyQWERTY avatar Sep 02 '21 16:09 AyQWERTY

+1 Using rotating residential proxies @drawrowfly please take a look

asportnoy avatar Sep 02 '21 19:09 asportnoy

Issue just fixed itself for me. Anyone else? Edit: nevermind, now failing again.

asportnoy avatar Sep 02 '21 19:09 asportnoy

This was not the fix and was just a coincidence.

Original fix I found a fix which I released to my app about half an hour ago. So far it seems to be working pretty well. The "options" on the `tt_webid_v2` cookie seems to have caused some issues, not sure why. Removing them seems to fix it. I can't make a pull request right now but someone else is welcome to do so.

As a temporary fix, go into the node module and edit build/core/TikTok.js. Replace line 167 with the following:

this.cookieJar.setCookie(`tt_webid_v2=69${helpers_1.makeid(17)};`, 'https://tiktok.com');

Let me know if this works for anyone or if you notice any issues with it. Enjoy!

Tip: If you're using the CLI, you can find the location of your node_modules folder by running npm root -g.

asportnoy avatar Sep 02 '21 23:09 asportnoy

So the issue has come back for me intermittently

From what I can tell, the main thing we need to implement is the ttwid cookie (note: different from tt_webid_v2). The cookie is generated from a post request to https://www.tiktok.com/ttwid/check/ (set-cookie header). That request requires a fid parameter but I can't tell what generates that.

I also noticed this new script which seems relevant to the changes: https://www.tiktok.com/acrawler/webmssdk.js I was able to partially de-obfuscate that with http://jsnice.org/.

Hopefully this information was helpful.

asportnoy avatar Sep 03 '21 01:09 asportnoy

Related: https://github.com/davidteather/TikTok-Api/issues/685

asportnoy avatar Sep 03 '21 01:09 asportnoy

I found a fix which I released to my app about half an hour ago. So far it seems to be working pretty well. The "options" on the tt_webid_v2 cookie seems to have caused some issues, not sure why. Removing them seems to fix it. I can't make a pull request right now but someone else is welcome to do so.

As a temporary fix, go into the node module and edit build/core/TikTok.js. Replace line 167 with the following:

this.cookieJar.setCookie(`tt_webid_v2=69${helpers_1.makeid(17)};`, 'https://tiktok.com');

Let me know if this works for anyone or if you notice any issues with it. Enjoy!

Tip: If you're using the CLI, you can find the location of your node_modules folder by running npm root -g.

All my requests stopped working last night. I.e. if before at least getUserProfileInfo worked, now even it doesn't work for me. All calls end with "Error: Can't extract user metadata from the html page. Make sure that user does exist and try to use proxy". I tried what you partially did, but unfortunately it didn't work for me. That's why I let all traffic from TikTok through Proxifier and it worked (not the solution, but at least it worked for me ;)).

AyQWERTY avatar Sep 03 '21 07:09 AyQWERTY

Seeing this as well Tested with mobile phone ips (which worked best in testing so far - no blocking whatsoever)

rzv avatar Sep 03 '21 12:09 rzv

I heavily reduced my request rate and I seem to be having a decent success rate now. Don't want to speak too soon but looks promising.

asportnoy avatar Sep 03 '21 17:09 asportnoy

So far most "solutions" seem to be using proxies, which is what I thought we're all already doing... If you reduce requests down to the ground and constantly rotate proxies, sure you won't get blocked, but you're also going to be rotating more frequently costing more $$ and on top of that getting data less frequently too.

isaackogan avatar Sep 03 '21 19:09 isaackogan

Youtube does the same thing to IPs that request too much data during an undisclosed threshold amount of time. Just put your script behind a reasonable timed sleep call.

garoto avatar Sep 03 '21 20:09 garoto

Youtube does the same thing to IPs that request too much data during an undisclosed threshold amount of time. Just put your script behind a reasonable timed sleep call.

I have 30 minutes between calls

rzv avatar Sep 03 '21 20:09 rzv

I have 30 minutes between calls

Then your originating IP is already throttled down perhaps?

garoto avatar Sep 03 '21 21:09 garoto

I have 30 minutes between calls

Then your originating IP is already throttled down perhaps?

They've always done this, but TikTok seems to be more strict now for user posts, i.e something has changed recently and we just don't know what

isaackogan avatar Sep 04 '21 02:09 isaackogan

My guess is some missing or invalid parameter is what's flagging it, so we should figure out what that parameter is and how to generate/implement it.

From what I can tell, there are 2 different cookies added: ttwid and R6kq3TV7. There is also a msToken and X-Bogus query param, although msToken is sometimes blank

asportnoy avatar Sep 04 '21 02:09 asportnoy

I have 30 minutes between calls

Then your originating IP is already throttled down perhaps?

No - the tests were made with 4G ips (tethering from several colleagues phones) like this:

  1. Local script on my laptop (the script that used to work fine)
  2. Connect to colleague's phone wifi
  3. Test the script -> fail
  4. Repeat for several phone providers and locations -> fail

We still see random successes in production but the fail rate is ~80-90%. The thing that surprises me is that it fails for 'fresh' 4g ips. Also, not talking proxies here And i got consistent fails.

Sorr for the incoherent bug report but we still struggle to see a pattern

rzv avatar Sep 04 '21 10:09 rzv

Hi,

This is the first time I'm writing on a Github issue so apologies if my reply is incomplete.

I am also having this issue whereby I am now getting 0 posts in the collector using the .user function. I use a rotating proxy. The issue began around 2nd September 18:00 UTC. All of my proxies now are getting this.

I hope the time stamp of when it started may be useful for this issue. Thanks.

ThatSameer avatar Sep 05 '21 16:09 ThatSameer

I use the rotating proxy data can be requested, if your is residential proxies will be sealing IP

what

isaackogan avatar Sep 06 '21 01:09 isaackogan

I use the rotating proxy data can be requested, if your is residential proxies will be sealing IP

what

Rotating proxy can be used to request data, if your agent is residential proxies, then your IP will be limited

BK-Go-Python avatar Sep 06 '21 09:09 BK-Go-Python

Rotating proxy can be used to request data, if your agent is residential proxies, then your IP will be limited

This is not a proxy issue. We have clearly established that this is an issue with the library.

isaackogan avatar Sep 06 '21 20:09 isaackogan

Any update with this issue, any fix or so ?

roman-hrybinchuk avatar Sep 07 '21 10:09 roman-hrybinchuk

Any update with this issue, any fix or so ?

patience

drawrowfly avatar Sep 07 '21 11:09 drawrowfly

I was getting 0 data back, even after setting --session sid_tt=MY_SID_TT but I turned on NordVPN in "obfuscated" mode (which is supposed to avoid looking like a VPN) and it's flowing now

This ^ isn't doing it for me anymore. Switching to a new NordVPN server works only for one or two API calls. Implementing an exponential backoff didn't help. I have been looking for a way to programmatically make NordVPN switch VPN servers on macOS client but that functionality only seems widely available for *nix or windows.

I even tried creating a Tor proxy on my localhost that rotates IP's every couple requests and feeding that to tiktok-scraper, like --proxy socks5://localhost:9050. It seems like I was successful in creating a local tor proxy, like it works for my web browser, but it doesn't work with TikTok-API. Maybe I need to find a way to pass verifyfP or something.

boscacci avatar Sep 08 '21 22:09 boscacci

i find msToken in "https://www.tiktok.com/acrawler/webmssdk.js"

function () { let _0x5a5c69 = _0x4c1915(); _0x5a5c69 && (_0x366f76['msToken'] = _0x5a5c69, _0x366f76['msStatus'] = _0x5f1248['asgw']), setTimeout(function () { _0x31f5e3(), _0xeabaae(), _0x1e84bf(), _0x57197e(); }, -0x670 + 0x7be * 0x4 + -0xcd0), _0x2f5cef(['/web/report']); }()

but i can't run it

BK-Go-Python avatar Sep 09 '21 03:09 BK-Go-Python

i find msToken in "https://www.tiktok.com/acrawler/webmssdk.js"

function () { let _0x5a5c69 = _0x4c1915(); _0x5a5c69 && (_0x366f76['msToken'] = _0x5a5c69, _0x366f76['msStatus'] = _0x5f1248['asgw']), setTimeout(function () { _0x31f5e3(), _0xeabaae(), _0x1e84bf(), _0x57197e(); }, -0x670 + 0x7be * 0x4 + -0xcd0), _0x2f5cef(['/web/report']); }()

but i can't run it

It's too difficult

BK-Go-Python avatar Sep 09 '21 03:09 BK-Go-Python

i find msToken in "https://www.tiktok.com/acrawler/webmssdk.js"

function () { let _0x5a5c69 = _0x4c1915(); _0x5a5c69 && (_0x366f76['msToken'] = _0x5a5c69, _0x366f76['msStatus'] = _0x5f1248['asgw']), setTimeout(function () { _0x31f5e3(), _0xeabaae(), _0x1e84bf(), _0x57197e(); }, -0x670 + 0x7be * 0x4 + -0xcd0), _0x2f5cef(['/web/report']); }()

but i can't run it

The issue isn't necessarily the msToken, and either way that isn't actually the token, but a reference to it

isaackogan avatar Sep 09 '21 03:09 isaackogan

either

So where should we start

BK-Go-Python avatar Sep 09 '21 03:09 BK-Go-Python

I was getting 0 data back, even after setting --session sid_tt=MY_SID_TT but I turned on NordVPN in "obfuscated" mode (which is supposed to avoid looking like a VPN) and it's flowing now

This ^ isn't doing it for me anymore. Switching to a new NordVPN server works only for one or two API calls. Implementing an exponential backoff didn't help. I have been looking for a way to programmatically make NordVPN switch servers on macOS but that functionality only seems widely available for nix or windows.

I even tried creating a tor proxy on my localhost and feeding that to tiktok-scraper, like --proxy socks5://localhost:9050. It seems like I was successful in creating a local tor proxy, like it works for my web browser, but it doesn't work with TikTok-API. Maybe I need to find a way to pass verifyfP or something.

They detecting tiktok-scraper and block by ip address. With fresh proxy you can make 1-2 requests, then you are banned.

ncsft avatar Sep 09 '21 06:09 ncsft

They detecting tiktok-scraper and block by ip address. With fresh proxy you can make 1-2 requests, then you are banned.

Right; so I tried rotating my Tor IP's with each request, and I still haven't gotten one request to work through Tor. It seems like TikTok can tell the request is coming over Tor, or something is acting unexpectedly with TikTok-API's proxy feature.

fwiw, I get this warning (node:2983) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version. when I pass TikTok-API my localhost Tor proxy

boscacci avatar Sep 09 '21 13:09 boscacci

I have 30 minutes between calls

Then your originating IP is already throttled down perhaps?

No - the tests were made with 4G ips (tethering from several colleagues phones) like this:

1. Local script on my laptop (the script that used to work fine)

2. Connect to colleague's phone wifi

3. Test the script -> fail

4. Repeat for several phone providers and locations -> fail

We still see random successes in production but the fail rate is ~80-90%. The thing that surprises me is that it fails for 'fresh' 4g ips. Also, not talking proxies here And i got consistent fails.

Sorr for the incoherent bug report but we still struggle to see a pattern

Also just did a test via 4G hotspot AND created a new account and was able to get the script to produce when IP was blocked via network wifi.

JimJones13 avatar Sep 10 '21 14:09 JimJones13

I've investigated about requests from TikTok UI and seems like we need to understand how to generate x-tt-params request header. Issue in this part

denispostilnyak avatar Sep 13 '21 16:09 denispostilnyak

All I see on this GH issue is a bunch of people who never managed to produce/generate a reproducible scenario. No wonder drawrowfly is ignoring this issue for this long lol. I wish this was locked and set to members-only so I could stop receiving notifications.

garoto avatar Sep 13 '21 18:09 garoto

Damn that's cool...

Sorry for the notification btw. But not really.

Most comments are people actively trying to reproduce and pool together resources, and while it would be quieter if he locked it, it wasn't reaaallly worth the snarky comment

isaackogan avatar Sep 13 '21 18:09 isaackogan

"snarky"

There's nothing "snarky" about what I wrote.

garoto avatar Sep 13 '21 18:09 garoto

Typical third-world native mindset right there, lol (expat BRs sao hilarios).

So far reading this issue, nothing reproducible was demonstrated. All I see is a bunch of what ifs, but not a single tcpdump to be seen.

I have being downloading tiktok content using this program for quite some time now with ZERO issues, but NO, i'm the retarded one; yeah right.

This is a shitty bug report to begin with.

garoto avatar Sep 13 '21 19:09 garoto

All I see on this GH issue is a bunch of people who never managed to produce/generate a reproducible scenario. No wonder drawrowfly is ignoring this issue for this long lol

There are many comments in here that have been able to reproduce it, so I don't know what makes you say that. And on top of that Andrew (creator) acknowledged the issue. We know it is an issue, we just don't know the fix.

Andrew has other things to do and we can't expect him to work on this 24/7 for free.

This is a shitty bug report to begin with.

No it's not. They thoroughly explained the issue and gave all the requested information. It is a legitimate issue that other people are able to reproduce.

In conclusion, kindly shut up.

asportnoy avatar Sep 13 '21 21:09 asportnoy

Please no off topic, i'm aware about changes made by tiktok and that the scraper isn't stable right now

drawrowfly avatar Sep 13 '21 22:09 drawrowfly

few days ago, scraper work good ,but today it always fail, i think it made by tiktok upgrade,especially tiktok api domain change...just my guess

JorjanLLT avatar Sep 14 '21 09:09 JorjanLLT

Not a single tcpdump to be seen.

I've been writing python for a living for ~3 short years and I haven't yet needed to know what a tcpdump is. Call me green but it might actually be helpful if you demonstrated how posting a tcpdump gets us closer to understanding the problem at hand

I have being downloading tiktok content using this program for quite some time now with ZERO issues

Have you been able to identify what you're doing right that we're not doing? Can you add it to the readme?

boscacci avatar Sep 14 '21 15:09 boscacci

I have being downloading tiktok content using this program for quite some time now with ZERO issues, but NO, i'm the retarded one; yeah righ

FIRST off, I've been following this thread closely to figure out possibly how to resolve this issue. So thank you to everyone trying to figure this out!

2nd, how much data are you pulling. I can reproduce this bug across 3 environments (personal, GCP and self-hosted cluster), with 100+ proxies. I can get MAYBE get 1000k requests if I'm lucky, now its more like 3-5. We had many scrapers all running in their own ways (CLI, Docker, and custom scripts) and ALL started to see increase failure rates.

Tests:

  • Refresh proxies, barely works, maybe get a set of requests in but doesnt last long
  • New session token: Best results, got me 1000 requests, but not practical to do and fails quicky
  • Removed the proxies, works, but then the usual tiktok blacklisting steps in (makes me think, as others have said, that this issue is in proxy detection)
  • Every combination of these steps. 90% of which end in "Failed to get user html" or an empty collector.

Python's scraper is also failing

https://tikapi.io/ (paid) DOES seem to be working, but judging by their features, theyre doing a more emulated approach, so probably not as useful.

I would love to contribute more this conversation and share reproducibility and tests for anyone who finds that useful.

victoryforphil avatar Sep 15 '21 03:09 victoryforphil

I was getting 0 data back, even after setting --session sid_tt=MY_SID_TT but I turned on NordVPN in "obfuscated" mode (which is supposed to avoid looking like a VPN) and it's flowing now

This ^ isn't doing it for me anymore. Switching to a new NordVPN server works only for one or two API calls. Implementing an exponential backoff didn't help. I have been looking for a way to programmatically make NordVPN switch servers on macOS but that functionality only seems widely available for nix or windows. I even tried creating a tor proxy on my localhost and feeding that to tiktok-scraper, like --proxy socks5://localhost:9050. It seems like I was successful in creating a local tor proxy, like it works for my web browser, but it doesn't work with TikTok-API. Maybe I need to find a way to pass verifyfP or something.

They detecting tiktok-scraper and block by ip address. With fresh proxy you can make 1-2 requests, then you are banned.

i dont think so, i use my personal mac with scraper and proxy, of course it fail, but just visit tiktok website via chrome ,its always good, no fail, so i guess these posts fail made by tiktok api upgrade. get the correct query params is important

JorjanLLT avatar Sep 15 '21 06:09 JorjanLLT

I was getting 0 data back, even after setting --session sid_tt=MY_SID_TT but I turned on NordVPN in "obfuscated" mode (which is supposed to avoid looking like a VPN) and it's flowing now

This ^ isn't doing it for me anymore. Switching to a new NordVPN server works only for one or two API calls. Implementing an exponential backoff didn't help. I have been looking for a way to programmatically make NordVPN switch servers on macOS but that functionality only seems widely available for nix or windows. I even tried creating a tor proxy on my localhost and feeding that to tiktok-scraper, like --proxy socks5://localhost:9050. It seems like I was successful in creating a local tor proxy, like it works for my web browser, but it doesn't work with TikTok-API. Maybe I need to find a way to pass verifyfP or something.

They detecting tiktok-scraper and block by ip address. With fresh proxy you can make 1-2 requests, then you are banned.

i dont think so, i use my personal mac with scraper and proxy, of course it fail, but just visit tiktok website via chrome ,its always good, no fail, so i guess these posts fail made by tiktok api upgrade. get the correct query params is important

bad news, today i test scraper with proxy, then it failed. and i go to the tiktok web ,unfortunately i got ip banned, icant view the web content...seem like tiktok developers know the scraper works and ban the scraper work's ips...😭

JorjanLLT avatar Sep 16 '21 04:09 JorjanLLT

I was getting 0 data back, even after setting --session sid_tt=MY_SID_TT but I turned on NordVPN in "obfuscated" mode (which is supposed to avoid looking like a VPN) and it's flowing now

This ^ isn't doing it for me anymore. Switching to a new NordVPN server works only for one or two API calls. Implementing an exponential backoff didn't help. I have been looking for a way to programmatically make NordVPN switch servers on macOS but that functionality only seems widely available for nix or windows. I even tried creating a tor proxy on my localhost and feeding that to tiktok-scraper, like --proxy socks5://localhost:9050. It seems like I was successful in creating a local tor proxy, like it works for my web browser, but it doesn't work with TikTok-API. Maybe I need to find a way to pass verifyfP or something.

They detecting tiktok-scraper and block by ip address. With fresh proxy you can make 1-2 requests, then you are banned.

i dont think so, i use my personal mac with scraper and proxy, of course it fail, but just visit tiktok website via chrome ,its always good, no fail, so i guess these posts fail made by tiktok api upgrade. get the correct query params is important

bad news, today i test scraper with proxy, then it failed. and i go to the tiktok web ,unfortunately i got ip banned, icant view the web content...seem like tiktok developers know the scraper works and ban the scraper work's ips...😭

Same thing happened to me, returns status 200 with empty body. They are now blocking requests, but not all of them, right know i'm blocked in the feed requests (/api/post/item_list), but the request of user profile (/node/share/user/) is fine. Also if you login everthing works as expected.

Agrafador avatar Sep 16 '21 08:09 Agrafador

The guys from davidteather's TikTok-Api seem to be moving forward.

It might be worth checking their progress so far to learn what they have learned: davidteather/TikTok-Api#695

It makes no sense to develop such scrapers. Tiktok will introduce new traps and ban those who use them. It's an endless race that cannot be won. Use headless browsers.

ncsft avatar Sep 17 '21 07:09 ncsft

The guys from davidteather's TikTok-Api seem to be moving forward.

It might be worth checking their progress so far to learn what they have learned: davidteather/TikTok-Api#695

It makes no sense to develop such scrapers. Tiktok will introduce new traps and ban those who use them. It's an endless race that cannot be won. Use headless browsers.

Lol, it make no sense on why you are here then and writing this message

drawrowfly avatar Sep 17 '21 07:09 drawrowfly

The guys from davidteather's TikTok-Api seem to be moving forward. It might be worth checking their progress so far to learn what they have learned: davidteather/TikTok-Api#695

It makes no sense to develop such scrapers. Tiktok will introduce new traps and ban those who use them. It's an endless race that cannot be won. Use headless browsers.

I tried using a headless browser and it often popped up with a sliding captcha I was desperate

BK-Go-Python avatar Sep 17 '21 09:09 BK-Go-Python

I wish I had some popcorn when I read this thread. lmaooooo

JeremiahMorenoArk avatar Sep 17 '21 09:09 JeremiahMorenoArk

I used the login cookie to request information and got “{'status_code': 2484, 'status_msg': 'Too many attempts. Try again in 1 hour.', 'log_pb': {'impr_id': '202109180828510102451470991C014BD9'}}” 🤦‍♀️🤦‍♀️🤦‍♀️

BK-Go-Python avatar Sep 18 '21 08:09 BK-Go-Python

Im having this issue "try to use proxy at TikTokScraper.getUserProfileInfo" once a while it's working do you think it's a proxy issue ?

akaoppa avatar Sep 19 '21 17:09 akaoppa

Im having this issue "try to use proxy at TikTokScraper.getUserProfileInfo" once a while it's working do you think it's a proxy issue ?

Ready this thread & come back if you still have the same question. But given the entire thread is dedicated to the fact that this specific method isn't working... I'm going to say you won't.

isaackogan avatar Sep 20 '21 20:09 isaackogan

Tiktok require msToken and X-Bogus query params while get user's posts.

Anybody resolved how do they generate these params?

wiliam-toney avatar Sep 21 '21 14:09 wiliam-toney

We should pin this issue

asportnoy avatar Sep 21 '21 19:09 asportnoy

https://github.com/davidteather/TikTok-Api/releases/tag/V4.0.2 also has been updated to create these parameters

Xodarap avatar Sep 22 '21 04:09 Xodarap

few days ago, scraper work good ,but today it always fail, i think it made by tiktok upgrade,especially tiktok api domain change...just my guess

This open source project make the TikTok Engineer easier to find out how people scraping their content and they will update their system to prevent us from doing scraping.

lamualfa avatar Sep 28 '21 00:09 lamualfa

Hello, are there any updates on this issue? I don't want to rush anything, just checking on the progress. Thank you very much for your effort!

dencorg avatar Oct 04 '21 08:10 dencorg

Out of curiosity, would it make sense to create a signer function as an optional configuration parameter? The thinking being that it could optionally add signature headers given the raw request URL. I'm thinking about integrations w/ signing logic like this. That way each implementer could decide their comfort w/ adding headless browsers or not.

vjleblanc avatar Oct 06 '21 17:10 vjleblanc

I have been using the tiktok-signature in my fork for the last 9 days and that has solved this issue!

You can give it a try at https://github.com/zvictor/tiktok-scraper and let me know if any function fails for you.

zvictor avatar Oct 06 '21 18:10 zvictor

I have been using the tiktok-signature in my fork for the last 9 days and that has solved this issue!

You can give it a try at https://github.com/zvictor/tiktok-scraper and let me know if any function fails for you.

newbie here. How do i install your version?

gabrieLmark avatar Oct 06 '21 19:10 gabrieLmark

@zvictor Hello I am testing your fork, but getMusicFeed by music id method doesn't work now:( Its return "No more posts" exception message

evgenycherkasov avatar Oct 07 '21 05:10 evgenycherkasov

newbie here. How do i install your version?

To install locally:

git clone [email protected]:zvictor/tiktok-scraper.git
cd tiktok-scraper
npm i
npm run build

Then, for CLI access:

./bin/cli.js --help --verbose

For programmatic use, just move the new folder to where you used to have node_modules/tiktok-scraper and you are good to go.

zvictor avatar Oct 07 '21 16:10 zvictor

I am testing your fork, but getMusicFeed by music id method doesn't work now:( Its return "No more posts" exception message

Please run in verbose mode (adding --verbose or DEBUG=tiktok-scraper:*) and open an issue in my repo.

zvictor avatar Oct 07 '21 16:10 zvictor

newbie here. How do i install your version?

To install locally:

git clone [email protected]:zvictor/tiktok-scraper.git
cd tiktok-scraper
npm i
npm run build

Then, for CLI access:

./bin/cli.js --help

For programmatic use, just move the new folder to where you used to have node_modules/tiktok-scraper and you are good to go.

i know this is probably the last place to ask these questions, but other websites arent helping. When installing the original tiktok scraper, it runs but fails. When using yours, i get "zsh: permission denied: tiktok-scraper" when trying to run it. Is this a simple fix? am i dumb or am i doing something wrong?

gabrieLmark avatar Oct 07 '21 17:10 gabrieLmark

When using yours, i get "zsh: permission denied: tiktok-scraper" when trying to run it. Is this a simple fix? am i dumb or am i doing something wrong?

Could you send the cmd you run and the error message, in full?

zvictor avatar Oct 08 '21 07:10 zvictor

I have been using the tiktok-signature in my fork for the last 9 days and that has solved this issue!

You can give it a try at https://github.com/zvictor/tiktok-scraper and let me know if any function fails for you.

Woah, it's awesome fork. Thanks @zvictor.

lamualfa avatar Oct 08 '21 09:10 lamualfa

When using yours, i get "zsh: permission denied: tiktok-scraper" when trying to run it. Is this a simple fix? am i dumb or am i doing something wrong?

Could you send the cmd you run and the error message, in full?

hmm, i followed all the directions, but when tried to scrape a user i just get a perpetual TikTok Scraper Started message

Imgur

vnnegt avatar Oct 09 '21 03:10 vnnegt

@zvictor. I have cloned your branch but user and music do not return any posts for me. I am getting. Error: No more posts.

Doing like that

(async () => { try { const posts = await TikTokScraper.user('justinbieber', { number: 50 }); console.log(posts); } catch (error) { console.log(error); } })();

roman-hrybinchuk avatar Oct 09 '21 11:10 roman-hrybinchuk

I have been using the tiktok-signature in my fork for the last 9 days and that has solved this issue!

You can give it a try at https://github.com/zvictor/tiktok-scraper and let me know if any function fails for you.

I am getting TikTok Scraper StartedNo more posts and then it's just stuck at TikTok Scraper Started without scraping anything. I tried both from-file and user mode

sasoriza avatar Oct 09 '21 18:10 sasoriza

Hey, @zvictor any comment about 2 last comments ?

roman-hrybinchuk avatar Oct 13 '21 17:10 roman-hrybinchuk

So, It's discontinued? Is there any alternative around?

Edit: Found this.

angelfire76 avatar Oct 17 '21 13:10 angelfire76

problem solved? I can't figure out how to get its video from a specific channel,

try {
    const posts = await TikTokScraper.user('justinbieber', {
      number: 100
    });
    console.log(posts);
  } catch (error) {
    console.log(error);
  }

this code doesn't even work together with sessionList: ['sid_tt=58ba9e34431774703d3c34e60d584475;']

kepamuk avatar Oct 25 '21 19:10 kepamuk

same

UnixCro avatar Oct 26 '21 09:10 UnixCro

So, It's discontinued? Is there any alternative around?

Edit: Found this.

The best Tiktok downloader after tiktok-scraper is youtube-dl in my opinion, but it has the disadvantage that it is slower and is not able to download all videos at once. Unfortunately, tikup caused problems for me. Nevertheless, I hope that someone from the Github community will create a repository that has the ability to download the videos from Snaptik.com in order to both enable better video quality & finally be able to provide the videos without watermarks. That would help us temporarily until drawrowfly has fixed the problem.

Greeting UnixCro

UnixCro avatar Oct 26 '21 09:10 UnixCro

newbie here. How do i install your version?

To install locally:

git clone [email protected]:zvictor/tiktok-scraper.git
cd tiktok-scraper
npm i
npm run build

Then, for CLI access:

./bin/cli.js --help --verbose

For programmatic use, just move the new folder to where you used to have node_modules/tiktok-scraper and you are good to go.

I keep getting an error when trying to build

20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: `rimraf build && tsc`
22 error Exit status 1
23 error Failed at the [email protected] build script.

any ideas?

ColtraneNadler avatar Oct 27 '21 15:10 ColtraneNadler

newbie here. How do i install your version?

To install locally:

git clone [email protected]:zvictor/tiktok-scraper.git
cd tiktok-scraper
npm i
npm run build

Then, for CLI access:

./bin/cli.js --help --verbose

For programmatic use, just move the new folder to where you used to have node_modules/tiktok-scraper and you are good to go.

Hi victor, I've installed your fork via YARN but get the below cli error. But the cli.js file is in that path. I'm on a mac.

code: 'MODULE_NOT_FOUND', requireStack: [ '/Users/ME/.config/yarn/global/node_modules/tiktok-scraper/bin/cli.js'

Thanks!

Sav0ia avatar Oct 29 '21 00:10 Sav0ia

Any updates on how to download videos currently? If someone found a way, please notify me. Thanks

Felixxx99xx avatar Nov 10 '21 21:11 Felixxx99xx

Any update on it :( please notice me. Thanks so much

tuphamdev96 avatar Nov 17 '21 11:11 tuphamdev96

Version 1.4.22 works with methods - .getVideoMeta() and .getUserProfileInfo(). Method .user() returns empty array. @drawrowfly , I hope the info will be useful for a little fix..

kristianlaskarov avatar Dec 10 '21 11:12 kristianlaskarov

does getUserProfileInfo return a list of media?

ColtraneNadler avatar Dec 15 '21 02:12 ColtraneNadler

No, only the author info.

kristianlaskarov avatar Dec 15 '21 10:12 kristianlaskarov

No news about it ? it's been more than 6 months. It's surprising that nobody found a workaround for it yet

akaoppa avatar Dec 25 '21 13:12 akaoppa

No news about it ? it's been more than 6 months. It's surprising that nobody found a workaround for it yet

workarounds have been found, but ppl are keeping it to themselves because the TikTok will immediately patch it

vnnegt avatar Dec 25 '21 16:12 vnnegt

I've come from the closed issue #720. I haven't been able to read through the entirety of this issue since there are too many messages, but so far I haven't seen a common fix, and I'm not sure if what I'm about to mention has already been said. But I'm just going to drop in some info that I've found while trying to fix the issue myself.

after going through the src code in core/TikTok.ts I've traced the route of the main problem that everyone seems to be having (Can't extract user metadata from the html page. Make sure that user does exist and try to use proxy), to the async getUserProfileInfo method, specifically in the try-catch statement when splitting the const request object and assigning the value to const breakResponse.

It seems that the script tag (specifically the one with an id of __NEXT_DATA__) breakResponse is looking for no longer exists in the tiktok api? The only part of the response html that I found to contain any data relating to the user profile and video urls was in a script tag with an id of sigi-persisted-data when assigning window['SIGI_STATE'] a dictionary of meta data. 2 of the key values of interest to me were ItemList and ItemModule

TLDR in core/TikTok.ts the async method getUserProfileInfo tries to find a no longer existent script tag from the request's html, which seems to be the route of all our problems

BetterLifeR avatar Jan 04 '22 16:01 BetterLifeR

@BetterLifeR this PR https://github.com/drawrowfly/tiktok-scraper/pull/721 seems to address your concerns? Can we merge that?

vanities avatar Jan 06 '22 17:01 vanities

PR #721 seems to be a good fork to merge. I'm also working on a fork now which adds those implementations to the getUserProfileInfo method and reformats the response JSON to match the structure of the UserMetadata interface. This may take a while though as I've never worked in TypeScript before.

BetterLifeR avatar Jan 07 '22 14:01 BetterLifeR

Thanks! if anyone have an workaround for : getUserProfileInfo it would be nice

akaoppa avatar Jan 07 '22 22:01 akaoppa

I have a problem with get user profile info, it returns rounded number for following users, and likes if the number is greater than 15000.

Is there any way around this?

beshoo avatar Jan 07 '22 22:01 beshoo

Just as an update, I've got a fix for the 'SIGI_STATE' problem and I'm no longer experiencing a Can't extract user metadata from the html page. Make sure that user does exist and try to use proxy error. However it now seems that I'm having problems with the request-promise package (checking the package with npm shows that it's now deprecated), and I'm constantly getting ESOCKETTIMEDOUT

BetterLifeR avatar Jan 10 '22 20:01 BetterLifeR

1+

phithu avatar Jan 13 '22 13:01 phithu

same, getting ESOCKETTIMEDOUT

bleshik avatar Mar 02 '22 05:03 bleshik

It seems like they've changed cookies format. I guess nothing works now...

bleshik avatar Mar 02 '22 06:03 bleshik

@UnixCro

not able to download all videos at once.

What do you mean by this? This can download entire channels concurrently? How does it avoid getting rate limited or banned?

github-account1111 avatar Apr 01 '22 05:04 github-account1111

Anyone manage to make it works ? starting to have most of time : ESOCKETTIMEDOUT now It was working fine before, not sure if it's the proxies or not

akaoppa avatar May 15 '22 10:05 akaoppa

Yeah, it just doesn't work anymore, we had to switch to our own parser for out tasks.

bleshik avatar May 15 '22 14:05 bleshik