TikTok-Api
TikTok-Api copied to clipboard
[QUESTION] - How to use proxies to get anothor region TikToks?
Right now, I am able to fetch trending videos in my region only. I would like to be able to fetch anoyother region (like Japan) TikToks.
I was suggested to use proxies so I tried enabling VPN and it resulted into errors. If anyone can guide me on how I can successully set a proxy that would be great.
I also asked my colleagues from US to give me there mstoken so I can access TikTok from that region but that also didn't worked out.
I would be very thankfull for any kind of help.
Thanks
When creating a session, have you tired passing a list of proxies? https://github.com/davidteather/TikTok-Api/blob/main/TikTokApi/tiktok.py#L203
@Gereks123 - Thank you for your reply! Yes I tried passing the list of proxies and it gave me "playwright timeout 30000ms exceeded" error. Please share if you have a working solution for this. Thanks.
Or if you can share a sample code for the correct way to pass the proxy list, that would be great. Thanks
here is how I am passing the proxy:
await api.create_sessions(ms_tokens=[ms_token], num_sessions=1, sleep_after=3, context_options=context_options, proxies=['50.217.226.44:80'])
@AbubakrChan Hello, How about the following code?
await api.create_sessions(ms_tokens=[ms_token], num_sessions=1, sleep_after=3, context_options=context_options, proxies=[{"server": "http://50.217.226.44:80"}])