Skip to content

tiktok fetch_search_videos 返回数据为空 #237

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

Closed
hanhqc opened this issue Jan 17, 2025 · 6 comments
Closed

tiktok fetch_search_videos 返回数据为空 #237

hanhqc opened this issue Jan 17, 2025 · 6 comments
Labels
请查阅文档(Documentation) 文档包含解决方案,请先自行查阅(The documentation contains the solution, so please check it out for yourself first) 提问(question) 想得到更多的详细支持(Further information is requested)

Comments

@hanhqc
Copy link

hanhqc commented Jan 17, 2025

tiktok fetch_search_videos 通过关键词搜索视频的时候返回状态码是200,但是相应数据为空,这个咋回事

@hanhqc hanhqc added the 提问(question) 想得到更多的详细支持(Further information is requested) label Jan 17, 2025
@Johnserf-Seed
Copy link
Owner

Johnserf-Seed commented Jan 17, 2025

其他接口是否可用,使用了什么配置? 不按照要求提的issue将关闭,我不是上帝我没有读心术

@hanhqc hanhqc changed the title [QUESTION] tiktok fetch_search_videos 返回数据为空 Jan 17, 2025
Copy link

dosubot bot commented Jan 17, 2025

@hanhqc 你好!我是一个可以帮助你解决bug、回答问题,并成为贡献者的机器人。在等待人类维护者的过程中,我会尽力帮助你。

I found a similar closed issue where the fetch_search_videos function returned an empty response despite a 200 status code. The possible reasons for this include:

  1. No Videos Found: The search might not have found any videos for the given keyword and offset.
  2. No More Results: There might be no more results to fetch, indicated by the search.has_more being false and search.api_status_code being "0".
  3. Pagination Handling: The function uses pagination, and if the current offset does not yield any results, it updates the offset and continues. If no videos are found, it will eventually stop when the maximum count is reached or there are no more items to fetch [1].

These conditions can lead to an empty response even when the HTTP request is successful.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@hanhqc
Copy link
Author

hanhqc commented Jan 17, 2025

其他接口是否可用,使用了什么配置? 不按照要求提的issue将关闭,我不是上帝我没有读心术

根据接口样例 测试fetch_user_post_videos接口可以正常使用

Image

但是fetch_search_videos 返回数据为空

Image

@Johnserf-Seed
Copy link
Owner

Image

接口没有问题,你需要一个新的cookie和与之对应的设备id。https://f2.wiki/faq#tiktok-403-forbidden

@hanhqc
Copy link
Author

hanhqc commented Jan 17, 2025

Image

接口没有问题,你需要一个新的cookie和与之对应的设备id。https://f2.wiki/faq#tiktok-403-forbidden

换了登录后的cookie 可以正常回去返回数据了,这个接口是必须要登录吗,前面说的fetch_user_post_videos接口是不需要登录后的cookie的

@Johnserf-Seed
Copy link
Owner

Image
接口没有问题,你需要一个新的cookie和与之对应的设备id。https://f2.wiki/faq#tiktok-403-forbidden

换了登录后的cookie 可以正常回去返回数据了,这个接口是必须要登录吗,前面说的fetch_user_post_videos接口是不需要登录后的cookie的

不同接口风控不一样,我这里演示的是未登录的情况,如果你无法使用游客ck那么只能使用登录的ck

@Johnserf-Seed Johnserf-Seed added the 请查阅文档(Documentation) 文档包含解决方案,请先自行查阅(The documentation contains the solution, so please check it out for yourself first) label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
请查阅文档(Documentation) 文档包含解决方案,请先自行查阅(The documentation contains the solution, so please check it out for yourself first) 提问(question) 想得到更多的详细支持(Further information is requested)
Projects
None yet
Development

No branches or pull requests

2 participants