Russell-Newton / TikTokPy

Extract data from TikTok without needing any login information or API keys.
https://pypi.org/project/tiktokapipy/
MIT License
212 stars 27 forks source link

Data scraping unable to complete in 30.0s #80

Open duytran1332002 opened 1 year ago

duytran1332002 commented 1 year ago

My code:

import asyncio
from tiktokapipy.async_api import AsyncTikTokAPI

async def do_something():
    async with AsyncTikTokAPI() as api:
        video = await api.user("huydao")
        print(video)

asyncio.run(do_something())

but I have error: image

Anyone can fix it?

Russell-Newton commented 1 year ago

Please provide some more details such as where you're located and what version of the library you're using. There's a known issue with the user function that makes it not work in certain regions without a proxy.

duytran1332002 commented 1 year ago

Please provide some more details such as where you're located and what version of the library you're using. There's a known issue with the user function that makes it not work in certain regions without a proxy.

I am located in Viet Nam, I used the lasted version - 0.2.4. How I apply proxy to fix this problem?

Russell-Newton commented 12 months ago

Take a look at the documentation for the TikTokAPI class and for Playwright's Browser::launch() function. You can pass in browser launch args as kwargs for the TikTokAPI class. This includes proxy information.

LoliHaxxer commented 10 months ago

I tried TikTokApi and TikTokPy for scraping a user's videos, and both of them ended up in an issue that would allegedly be solved by using a proxy. Since both libraries are based on playwright, what is a proxy service that works well with playwright? I own one dedicated socks proxy with auth, but playwright fails on socks proxies with auth.

princewillingoo commented 10 months ago

@LoliHaxxer Have you been able to figure out a proxy service that works well with playwright?

I tried TikTokApi and TikTokPy for scraping a user's videos, and both of them ended up in an issue that would allegedly be solved by using a proxy. Since both libraries are based on playwright, what is a proxy service that works well with playwright? I own one dedicated socks proxy with auth, but playwright fails on socks proxies with auth.

LoliHaxxer commented 10 months ago

No I haven't, I just proceeded to scrape myself with Selenium

princewillingoo commented 10 months ago

No I haven't, I just proceeded to scrape myself with Selenium @LoliHaxxer Do you mind sharing how you go about doing that? I keep getting a CAPTCHA on the first request. If you don't mind I can drop a medium to contact me. Thanks.