davidteather / TikTok-Api

The Unofficial TikTok API Wrapper In Python
https://davidteather.github.io/TikTok-Api
MIT License
4.88k stars 975 forks source link

[BUG] - playwright._impl._errors.TimeoutError: Timeout 30000ms exceeded. #1185

Open wu5bocheng opened 3 months ago

wu5bocheng commented 3 months ago

Describe the bug Sometimes cannot fetch user info with

  user = self.api.user(username=username)
  await user.info()

Error Trace (if any)

Put the error trace below if there's any error thrown.

  File "/code/app/platforms/tiktok/TikTokFetcher.py", line 69, in author_by_username_v2
    await user.info()
  File "/usr/local/lib/python3.10/site-packages/TikTokApi/api/user.py", line 76, in info
    resp = await self.parent.make_request(
  File "/usr/local/lib/python3.10/site-packages/TikTokApi/tiktok.py", line 438, in make_request
    signed_url = await self.sign_url(encoded_params, session_index=i)
  File "/usr/local/lib/python3.10/site-packages/TikTokApi/tiktok.py", line 375, in sign_url
    x_bogus = (await self.generate_x_bogus(url, session_index=i)).get("X-Bogus")
  File "/usr/local/lib/python3.10/site-packages/TikTokApi/tiktok.py", line 362, in generate_x_bogus
    await session.page.wait_for_function("window.byted_acrawler !== undefined")
  File "/usr/local/lib/python3.10/site-packages/playwright/async_api/_generated.py", line 11022, in wait_for_function
    await self._impl_obj.wait_for_function(
  File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_page.py", line 1008, in wait_for_function
    return await self._main_frame.wait_for_function(**locals_to_params(locals()))
  File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_frame.py", line 773, in wait_for_function
    return from_channel(await self._channel.send("waitForFunction", params))
  File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 59, in send
    return await self._connection.wrap_api_call(
  File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 509, in wrap_api_call
    return await cb()
  File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 97, in inner_send
    result = next(iter(done)).result()
playwright._impl._errors.TimeoutError: Timeout 30000ms exceeded.

Desktop (please complete the following information):

GhyathSAhmed commented 2 months ago

same issue

witherBattler commented 2 months ago

Same issue, + it happens with the quickstart code