Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - user.videos returns empty response #1193

Open
prodbioject opened this issue Sep 16, 2024 · 2 comments
Open

[BUG] - user.videos returns empty response #1193

prodbioject opened this issue Sep 16, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@prodbioject
Copy link

prodbioject commented Sep 16, 2024

Describe the bug

I have tried other functions, they work. Only facing issues when I want to access user.videos, I get an empty response

The buggy code

async with TikTokApi() as api:
        await api.create_sessions(ms_tokens=[ms_token],
                                  num_sessions=1,
                                  sleep_after=3,
                                  headless=False)
        results = 10
        async for video in api.user("therock").videos(count=10):
            print(video)
            print(video.as_dict)

Expected behavior

Get a bunch of video JSON

Error Trace (if any)

Traceback (most recent call last):
  File "/path/to/your/project/backend/test_api.py", line 92, in <module>
    asyncio.run(main())
  File "/path/to/[email protected]/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/path/to/[email protected]/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/[email protected]/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/path/to/your/project/backend/test_api.py", line 89, in main
    await user_example()
  File "/path/to/your/project/backend/test_api.py", line 67, in user_example
    async for video in api.user("therock").videos(count=10):
  File "/path/to/venv/lib/python3.12/site-packages/TikTokApi/api/user.py", line 177, in videos
    resp = await self.parent.make_request(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/venv/lib/python3.12/site-packages/TikTokApi/tiktok.py", line 462, in make_request
    raise EmptyResponseException(
TikTokApi.exceptions.EmptyResponseException: None -> TikTok returned an empty response

Desktop (please complete the following information):

  • OS: macOS Sonoma Macbook M2 Pro
  • TikTokApi Version 6.4.0

Additional context

This call was working about 3 weeks ago, don't know what changed, but the user.videos is the only data in my app that I cannot access, the rest seems to work fine

@prodbioject prodbioject added the bug Something isn't working label Sep 16, 2024
@wpz5159582
Copy link

response : {'log_pb': {'impr_id': '20240918071705E35284F2FA7F9D0324F1'}, 'statusCode': 10201, 'statusMsg': '', 'status_code': 10201, 'status_msg': ''} But I don't know what this is and how to solve it

@Gereks123
Copy link

In personal experience when I started using proxies and added small delays between each account I fetch, the empty answers came back less and less.

You might get bot detected and you might not. Try using rotating proxies, if you encounter the "Empty response" run it again with a different IP from the proxy.

I'm personally using Bright Data Data Center proxies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants