Comments (11)
My guess is it's something with Puppeteer - maybe Tiktok figured out how to detect it. If you manually run through what the signer is doing, you can generate urls that are signed. But for some reason this doesn't work in the chromium instance Puppeteer launches.
For example
- go to https://www.tiktok.com/trending?lang=en
- in chrome dev tools console, run the following
- var t = {}
- webpackJsonp.filter(x => typeof x[1]['duD4'] === "function")[0][1].duD4(null, t)
- var url = 'https://m.tiktok.com/api/challenge/detail/?verifyFP=&challengeName=meme&language=en'
- var token = t.sign({url: url})
- var signedUrl = url + '&_signature=' + token
- signedUrl
This will print out a url that you can go to and see a non empty response
Edit: Updating sign call to use object instead of just the string
from tiktok-signature.
I made a mistake with step 4 in my previous comment (and updated it to correct value)
Replace
var token = t.sign(url)
with
var token = t.sign({url: url})
and that should work. I tested with "https://m.tiktok.com/api/user/detail/?uniqueId=who&language=en&verifyFp="
from tiktok-signature.
Hi David,
It seems that TikTok uses this structure for getting user data.
https://t.tiktok.com/api/user/detail/?uniqueId=worldeconomicforum&secUid=&verifyFp=
from tiktok-signature.
Do you mind telling me where you find these api endpoints for tiktok?
I've just been using google chrome's network inspector and my browser never hit that end point. Mine just seemed to hit the ones that I specified in my post.
Here's an image of a request it makes for user data.
Thanks!
Edit: Just tried that end point and it doesn't seem to work for me.
from tiktok-signature.
Hey there your workaround seems to only work for that url you sent. I've tested your theory on a few other endpoints which are the music & getting a user object endpoint from my initial post that don't seem to work in the google chrome console.
from tiktok-signature.
Thanks!
It's strange that TikTok only detects puppeteer on specific endpoints.
from tiktok-signature.
That's just my theory, and I'm not exactly an expert here, just wanted to share what I was seeing.
from tiktok-signature.
Yeah that seems to be the issue. I'm also not an expert, but I'm fairly certain that's what's going on.
I'm basically porting this project to a python package, and I'll look into avoiding detection. If I find a JavaScript equivalent I'll update this issue.
from tiktok-signature.
Swapping puppeteer out for playwright seems to be a fix. Though I don't know if there is an equivalent of the puppeteer-extra-plugin-stealth for playwright (or if it's still needed). Either way I'll send out a PR sometime this week.
from tiktok-signature.
Hi guys,
It's good to see that people are interested for this repo and trying to fix things.
I have just tested some links with the current code and everything worked very well.
For example I've tried generating signature for:
https://m.tiktok.com/api/user/detail/?uniqueId=who&language=en&verifyFp=
https://m.tiktok.com/api/challenge/detail/?verifyFP=&challengeName=meme&language=en
https://t.tiktok.com/api/user/detail/?uniqueId=fotbal_romania_memes&secUid=&verifyFp=
All of them are working very well and I can't see any issue with the current code. Probably there is some other reason for empty result.
All tests used trending.py file included in repo. The user-agent used should match when requesting for signature and when requesting for response.
I need some more information to find out where exactly is the issue using puppeteer.
Greetings.
from tiktok-signature.
Hello there,
We saw this issue too. It seems that tiktok started to use the parameter verifyFp.
Is it possible for you @carcabot to look at this verifyFp parameter to check if it's possible to get it the way you do to generate the signature?
I know that the purpose of this repo is to "generate the signature" and not generate the verifyFp. But it could be a nice addition for us.
Thanks,
from tiktok-signature.
Related Issues (20)
- trending.py returns empty response HOT 2
- Pulling data for all user videos? HOT 2
- Normal search example HOT 1
- How to sign a hashtag request? HOT 1
- python support HOT 4
- How do you get the downloadAddress to work? HOT 1
- X-bogus on video list api
- User-videos request is returning empty data
- URL length issue reported, localhost: 8080/signature
- Hashtag is only getting 30 results
- how to setup in vercel
- Fetch user info returns empty info HOT 2
- Fetching user videos not working on deployment HOT 4
- Frequent Empty String Returns in examples/user-video.js HOT 19
- Fail to get SEC_UID HOT 6
- How to get user infor HOT 6
- 请问 是否能在直接浏览器环境中使用
- How to get TT_REQ_PERM_URL for keyword search HOT 1
- Empty Response HOT 11
- TikTok not rendering when starting app HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tiktok-signature.