user.info returns null
Opened this issue · 2 comments
viktorkozachok21 commented
just tried the example code and it returns null for any user
atharahmed commented
Are you using this package with proxies?
Also, since TikTok doesn't work well with old versions of chrome try the following:
import { TikTokClient } from "tiktok-private-api";
(async () => {
const scraper = new TikTokClient();
// update user agent
scraper.state.defaultHeaders = {
...scraper.state.defaultHeaders,
"user-agent":
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
"sec-ch-ua":
'"Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108"',
};
const data = await scraper.user.info("redbull");
console.log(data);
})();
You might still get occasional empty results though
viktorkozachok21 commented
Thanks, works fine now
…On Tue, Dec 27, 2022 at 5:21 PM Athar Ahmed ***@***.***> wrote:
Are you using this package with proxies?
Also, since TikTok doesn't work well with old versions of chrome try the
following:
`import { TikTokClient } from "tiktok-private-api";
(async () => {
const scraper = new TikTokClient();
// update user agent
scraper.state.defaultHeaders = {
...scraper.state.defaultHeaders,
"user-agent":
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
"sec-ch-ua":
'"Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108"',
};
const data = await scraper.user.info("redbull");
console.log(data);
})();`
You might still get occasional empty results though
—
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKTR4WT67BV25C57FB5EMQLWPMCOPANCNFSM6AAAAAATKN6X24>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>