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]CLI 获取 tk 对应用户的视频列表返回响应内容为空 #276

Open
3 tasks done
Archivev opened this issue Feb 17, 2025 · 3 comments
Open
3 tasks done
Labels
等待反馈(feedback) 需要补充信息或配合测试(Feedbackers are required to add information or cooperate with the test) 无效(invalid) 非代码故障导致错误或异常(Non-code faults causing errors or anomalies)

Comments

@Archivev
Copy link

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

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

  • 我找到并查看了所有类似的问题但是经过努力尝试之后仍未解决问题

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

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

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

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

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

详细描述错误
简明扼要地描述遇到的错误。

系统平台

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

A:

  • 操作系统: [Mac macOs Sonoma 14.6.1]
  • 浏览器 [firefox 132.0.1 (64 位)]
  • 终端 [zsh]
  • F2版本 [0.0.1.7]

错误重现

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

A:

  1. 使用的命令:
    f2 -d DEBUG tk -M post -c my_apps.yaml
  2. my_apps.yaml 配置文件,已替换生成的device_id对应的 tt_chain_token 的值
    tiktok: cookie: ak_bmsc=********************~********************~************~**********; passport_csrf_token=************************; passport_csrf_token_default=************************; multi_sids=**********************; cmpl_token=************************; passport_auth_status=*************************; passport_auth_status_ss=*************************; uid_tt=*************************; uid_tt_ss=*************************; sid_tt=*********************; sessionid=*********************; sessionid_ss=*********************; tt-target-idc-sign=**************************; tt_chain_token=*******************; bm_sv=***************************; odin_tt=**************************; store-idc=****************; store-country-code=***; store-country-code-src=***; tt-target-idc=****************; ttwid=********************; sid_guard=**********************; sid_ucp_v1=************************; ssid_ucp_v1=************************; msToken=************************; tt_csrf_token=*******************; s_v_web_id=************************; delay_guest_mode_vid=5; perf_feed_cache={%22expireTimestamp%22:**************%2C%22itemIds%22:[**************%2C**************]}; tiktok_webapp_theme_source=auto; tiktok_webapp_theme=dark; passport_fe_beating_status=false; tt_ticket_guard_has_set_public_key=1; last_login_method=google desc: true interval: all mode: 'post' naming: '{create}_{desc}' page_counts: '20' url: 'https://www.tiktok.com/@gordonramsayofficial'
  3. config.yaml 配置文件,只展示 tiktok 相关,已替换 device_id
    tiktok: BaseRequestModel: browser: language: zh-CN name: Mozilla platform: Win32 version: 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 device: id: "7472295343289533995" platform: web_pc os: windows region: SG priority_region: "" webcast_language: zh-Hans tz_name: Asia/Hong_Kong headers: User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Referer: https://www.tiktok.com/ proxies: http://: https://: wss: domain: localhost port: 8766 verify: false msToken: url: https://mssdk-sg.tiktok.com/web/common?msToken=QnC7zMMh1cpaDTxHDHnabNOrqaWv49JwA1IAq3AIFvrdaqQi8Rs_YlXSya1vN-4b6C1MgpWpS2cL1oakaUEDe3pUDMLpCbdSc3b3V98Fux0AuwXn_9Ns3FyMTnFRmSOOOVeGg6bVXMSGoMG6dq3k url2: https://mssdk-sg.tiktok.com/web/report?msToken=QnC7zMMh1cpaDTxHDHnabNOrqaWv49JwA1IAq3AIFvrdaqQi8Rs_YlXSya1vN-4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lybiKHjDIMq7vc59NBw2VDQBmRqa8NTh2XLwIryjoBIHuNSBngSZwJE== ttwid: url: https://www.tiktok.com/ttwid/check/ data: '{"aid":1988,"service":"www.tiktok.com","union":false,"unionHost":"","needFid":false,"fid":"","migrate_priority":0}' cookie: ttwid=1%7C3uOVjidbOFBmdS6Aci5oeBb8Ta-HWpeyp2dvhl2Ib2E%7C1716637053%7C462867ee452aecd60a854225b854ff4498e9b99c13d4826a3e2a4e58a4c55134; odin_tt: url: https://www.tiktok.com/passport/web/auth/config?WebIdLastTime=1733387890&account_sdk_source=web&aid=1459&app_language=zh-Hans&app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F131.0.0.0%20Safari%2F537.36&channel=tiktok_web&cookie_enabled=true&data_collection_enabled=true&device_id=7444844253941876231&device_platform=web_pc&focus_state=true&from_page=fyp&history_len=3&is_fullscreen=false&is_page_visible=true&odinId=7444842897268327431&os=windows&priority_region=&referer=&region=TW&screen_height=1080&screen_width=1920&tz_name=Asia%2FHong_Kong&user_is_login=false&webcast_language=zh-Hans&msToken=Rr7x4_7ABrw16uXFR33lyk5_HML6vIUi6F_aAeqOy8dIVGXhgJaSB7y7s-8_X4dXdwcoy5RfUQKomZzOg8Hf_6dQwmqosHxTNcn0Y7-gwVjcJ0IW3pqwg5Aq9W-D1gZZ6dFoFFPucU8B2SJ_Ma4brk45tQ==
  4. app.yaml 配置文件,未改动,因为优先级顺序这里应该不需要改动
    tiktok: cookie: max_connections: 5 max_counts: 0 max_retries: 5 max_tasks: 5 naming: '{create}_{desc}' page_counts: 5 path: Download timeout: 10
  5. Q: 请添加调试命令f2 -d DEBUG重新运行出错的命令并提供日志目录下的日志文件。A:
Image Image

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

A:

预期行为
简明扼要地描述期望发生的事情。
希望可以正确的获得 tk 对应博主下的视频列表,希望可以帮忙协助排查是哪里的配置问题,device_id 和 tt_chain_token 已经替换,调用其他接口比如下载对应video_id 的单个视频可以下载成功,但是获取视频列表就是一直返回为空

屏幕截图
请添加截图以帮助解释你的问题。
参考上面问题截图

日志文件
请添加调试日志文件以帮助解释你的问题。

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

@Archivev Archivev added the 故障(bug) 代码问题导致的错误(Bugs caused by code problems) label Feb 17, 2025
@Archivev Archivev changed the title [BUG] [BUG]CLI 获取 tk 对应用户的视频列表返回响应内容为空 Feb 17, 2025
Copy link

dosubot bot commented Feb 17, 2025

Hello @Archivev, I'm here to assist you with any bugs, questions, or contributions. Let me know how I can help while you wait for a human maintainer.

The issue where the command f2 -d DEBUG tk -M post -c my_apps.yaml returns an empty video list for a TikTok user, despite having replaced the device_id and tt_chain_token, can be resolved by ensuring that both your cookie and the corresponding device ID are updated and consistently used. The empty results indicate that your credentials might be expired, even if other API calls like downloading a single video by video_id work successfully.

Instead of generating new device IDs using DeviceIdManager.gen_device_ids(), configure and bind a consistent device ID to your requests. This involves setting up a fixed device ID and ensuring it matches with the associated cookies in your configuration. Using dynamically generated device IDs can lead to empty API responses.

Additionally, check the cookie value in your configuration file for any incorrect characters such as newlines, spaces, or non-ASCII characters. Ensure that the TikTok web cookie is complete, as a short cookie can cause issues. If you used QR code login, the cookie might expire due to device environment risk control, so re-generate the cookie with --auto-cookie. Make sure to update your cookie and device ID by following the instructions provided at this FAQ page [1][2][3].

To continue talking to Dosu, mention @dosu.


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

@Johnserf-Seed
Copy link
Owner

与代理ip有关,实测非美国地区可以

@Johnserf-Seed Johnserf-Seed added 等待反馈(feedback) 需要补充信息或配合测试(Feedbackers are required to add information or cooperate with the test) 无效(invalid) 非代码故障导致错误或异常(Non-code faults causing errors or anomalies) and removed 故障(bug) 代码问题导致的错误(Bugs caused by code problems) labels Feb 19, 2025
@Archivev
Copy link
Author

与代理ip有关,实测非美国地区可以

明白,我看有挺多人被这个问题困扰的,所以我想保持环境的一致性,有无代理推荐呢,因为这里也尝试过好几个发现都不行,我看到后你可以选择删掉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
等待反馈(feedback) 需要补充信息或配合测试(Feedbackers are required to add information or cooperate with the test) 无效(invalid) 非代码故障导致错误或异常(Non-code faults causing errors or anomalies)
Projects
None yet
Development

No branches or pull requests

2 participants