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

增加抖音浏览量的接口无法使用,响应内容一直为空。 #262

Open
2 of 4 tasks
okiter opened this issue Feb 5, 2025 · 4 comments
Open
2 of 4 tasks
Labels
故障(bug) 代码问题导致的错误(Bugs caused by code problems)

Comments

@okiter
Copy link

okiter commented Feb 5, 2025

  • 我查看了 文档 以及 已关闭的问题 以寻找可能的解决方案。

  • 我在 常见的问题与解决办法 中找不到我的问题。

  • 你的问题是公开的,请注意删除个人敏感内容再上传

  • 不按照模板填写的问题将不会得到优先的处理。

  • 如果错误问题是可视化的,请在屏幕截图贴截图。如果你是开发者请在错误重现提供一个最小的代码示例来演示该问题。

  • 相同的问题将会被标记重复(duplicate),如果你的问题被标记为已确认(confirmed)则会在后续的推送中修复,请时刻留意。

  • 退订邮件提醒请点击邮件的底部unsubscribe

详细描述错误
1、将f2从github上clone下来之后,进行pip install 按照相关依赖包
2、直接运行docs/snippets/douyin/post-stats.py之后,一直提示响应内容为空。
3、采用默认的cookie和登录账号的cookie都已经尝试过了。
Image
Image
4、使用登录账号的cookie,运行docs/snippets/douyin下的其他功能是正常的。 确定cookie是没有问题的。

系统平台

单击展开 Q:你在哪个平台(Win/Linux/Mac)上运行?你使用的是什么浏览器?你使用的是什么终端软件?你使用的F2是什么版本?

A:

  • 操作系统: [e.g. Win10 x64 22H2 19045.4046]
  • 浏览器 [e.g. Edge 122.0.2365.52]
  • 终端 [e.g. WT 1.18.10301.0]
  • F2版本 [e.g. 0.0.1.8]

错误重现

单击展开 Q: 请你复制并粘贴出错时运行的命令和配置文件内容,以及重现该行为的步骤。如果你一次性就提供完整信息,就会节省很多解决问题的时间。

A:

  1. 请看详细描述错误

Q: 请添加调试命令f2 -d DEBUG重新运行出错的命令并提供日志目录下的日志文件。

A:

Q: 如果是开发者请提供最小的代码示例

A:

预期行为
期望调用接口fetch_post_stats能够正常增加播放量。

屏幕截图
请看详细描述错误
日志文件
2025-02-05 16:03:49,291 - f2 - WARNING - 第 1 次请求响应内容为空, 状态码: 200, URL:https://www.douyin.com/aweme/v2/web/aweme/stats/?device_platform=webapp&aid=6383&channel=channel_pc_web&pc_client_type=1&publish_video_strategy_type=2&pc_libra_divert=Windows&version_code=290100&version_name=29.1.0&cookie_enabled=true&screen_width=1920&screen_height=1080&browser_language=zh-CN&browser_platform=Win32&browser_name=Edge&browser_version=130.0.0.0&browser_online=true&engine_name=Blink&engine_version=130.0.0.0&os_name=Windows&os_version=10&cpu_core_num=12&device_memory=8&platform=PC&downlink=10&effective_type=4g&round_trip_time=100&msToken=DYC8HWkopljiAP9MRi8Tbtz5lyo_3h6yb4-d0vk3_buVUi6G6mNibJu4SmzcTNTY3YV3W42O2VLhirqNhSRQRhf4IEYQUqEEK10nucd_xai7rcdYQ_H05PHDjJrWLfM=&aweme_type=0&item_id=7467485482314763572&play_delta=1&source=0&a_bogus=QfmZBQzVpnyPkESb5X2LfY3q6ve3YQif0SVkMD2fUdfPty39HMTH9exofqivMeyjxs/gIeSjy4hbTrcBrQCb0Zwf9SUq/2CZsL40t-Ph5xSSs1feeL8DJ4Jx-kTAFee/Rv93EcvsqiKcKRbs09Qa-vIlO6ZCcHgOEisnOtY=

其他
如有,可以添加有关问题的其他信息。

@okiter okiter added the 故障(bug) 代码问题导致的错误(Bugs caused by code problems) label Feb 5, 2025
@okiter okiter changed the title [BUG] 增加抖音浏览量的接口无法使用,响应内容一直为空。 Feb 5, 2025
Copy link

dosubot bot commented Feb 5, 2025

@okiter 你好!我是Dosu,我是一个可以帮助你解决错误、回答问题以及成为贡献者的机器人。在等待人类维护者的过程中,我可以帮助你。

To address the issue of the post-stats.py script returning an empty response with a status code of 200, ensure that the cookies are generated correctly using the TokenManager utility. The script relies on TokenManager.gen_real_msToken() and TokenManager.gen_ttwid() to generate necessary cookies. If these tokens are invalid or not generated correctly, it could lead to empty responses. Additionally, verify that the aweme_id and other parameters are correct and that the DouyinHandler is functioning as expected. If the issue persists, check the logs for any warnings or errors that might provide more insight into the problem [1].

To continue talking to Dosu, mention @dosu.


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

@okiter
Copy link
Author

okiter commented Feb 6, 2025

@okiter 你好!我是Dosu,我是一个可以帮助你解决错误、回答问题以及成为贡献者的机器人。在等待人类维护者的过程中,我可以帮助你。

To address the issue of the post-stats.py script returning an empty response with a status code of 200, ensure that the cookies are generated correctly using the TokenManager utility. The script relies on TokenManager.gen_real_msToken() and TokenManager.gen_ttwid() to generate necessary cookies. If these tokens are invalid or not generated correctly, it could lead to empty responses. Additionally, verify that the aweme_id and other parameters are correct and that the DouyinHandler is functioning as expected. If the issue persists, check the logs for any warnings or errors that might provide more insight into the problem [1].

To continue talking to Dosu, mention @dosu.

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

你的回答并不能解决以上问题。

@Johnserf-Seed
Copy link
Owner

排查了一下,目前播放量接口的参数校验最严格,必须携带content-type,参数位置不能改动,ab为最新版192位的,x-secsdk-csrf-token(可有可无)

@okiter
Copy link
Author

okiter commented Feb 8, 2025

排查了一下,目前播放量接口的参数校验最严格,必须携带content-type,参数位置不能改动,ab为最新版192位的,x-secsdk-csrf-token(可有可无)

作者你好, 目前a_bogus参数已经是204位了, f2的a_bogus参数是164位。 希望大佬更新一下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
故障(bug) 代码问题导致的错误(Bugs caused by code problems)
Projects
None yet
Development

No branches or pull requests

2 participants