-
-
Notifications
You must be signed in to change notification settings - Fork 914
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
Getting more video ids than 30 fails #1119
Comments
hey, try to look through this code |
same here, more than 35 videos fail |
I've had mixed luck with trying to scrape large amounts at once. I'll post a modified version of your code adding the changes I've made that seem to work best, though I see a strong positive correlation between failure rate and post count (especially for profiles with >1000 posts). Codefrom TikTokApi import TikTokApi
import asyncio
import os
ms_token = os.environ.get(
"ms_token", None
)
async def user_example(username):
async with TikTokApi() as api:
await api.create_sessions(headless=False, ms_tokens=[ms_token], num_sessions=1, sleep_after=3)
user = api.user(username)
user_data = await user.info()
post_count = user_data["userInfo"]["stats"].get("videoCount")
async for video in user.videos(count=post_count):
print(video)
video = str(video) + "\n"
with open('test1.json', 'a') as file:
file.write(video)
if __name__ == "__main__":
asyncio.run(user_example("truong_se")) BreakdownFirst, I added a Hope this is helpful! |
My goal is to get all the user's video ids, I used my own method, surprisingly it works perfectly, it doesn't miss a single video. This is my code:
|
When I set the count to 35 or higher, the same error occurs. I've encountered a limitation where I cannot retrieve information for more than 35 videos at once. However, I found a workaround using the This argument specifies the starting point for the count. By updating I hope this solution is helpful to you! |
Hi @koonn , I tried to use
Have you tried using it? Then can I see your code please? |
here is my code.
I actually use this solution for |
@koonn
Btw thanks for your solution. Have a nice day! |
Which version of TikTokApi are you using? Installing v6.2.2 broke user.videos() for me. Downgrading to 6.2.0 with |
I personally downgraded and I could fetch more than 30+ videos per account without issues! EDIT: wording |
Hi everyone,
I want to get all tiktok video id from a user, this is code:
in this line, I try edit count=30 to count=1000 but it doesn't work:
output:
2024-02-24 09:39:55,961 - TikTokApi.tiktok - ERROR - Got an unexpected status code: {'log_pb': {'impr_id': '202402240240321EB88FFC04941C07B40E'}, 'statusCode': 10201, 'statusMsg': '', 'status_code': 10201, 'status_msg': ''}
Is there any solution to fix this situation? Thanks.
The text was updated successfully, but these errors were encountered: