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] ERROR msToken API错误:msToken 内容不符合要求 INFO 生成虚假的msToken #733

Open
qq517739813 opened this issue Jun 22, 2024 · 8 comments
Labels
故障(bug) 代码问题导致的错误(Bugs caused by code problems) 已确认(confirmed) 该issue已被处理,将在下次推送中更新(The issue has been processed and will be updated in the next push)

Comments

@qq517739813
Copy link

根据多方面查看tiktok配置了代理获取了cookie之后报错 msToken API错误:msToken 内容不符合要求 INFO
尝试退出登录重新获取cookie依然这样
Snipaste_2024-06-22_15-26-10

@qq517739813 qq517739813 added the 故障(bug) 代码问题导致的错误(Bugs caused by code problems) label Jun 22, 2024
@Johnserf-Seed
Copy link
Owner

更新conf.yamlmsToken的配置即可,根据mssdk-sg.tiktok.com/web/common这个字段或者mssdk-sg.tiktok.com/web/report在开发者工具中复制请求负载即可。

@Johnserf-Seed Johnserf-Seed added the 已确认(confirmed) 该issue已被处理,将在下次推送中更新(The issue has been processed and will be updated in the next push) label Jun 23, 2024
@iDataist
Copy link

iDataist commented Jun 25, 2024

@Johnserf-Seed , 我按着你所指导的方法复制了开发者工具中的msToken,并且替换了\Lib\site-packages\f2\conf\conf.yaml中的两处msToken,还是看到了相同的错误。让我有点儿迷惑的是错误信息里的msToken并不是conf.yaml中的值。

我没有用代理。请帮忙指点有什么设置可能出了问题。我只是不能下载tiktok,可以下载抖音。
2
new

ERROR    msToken API错误:msToken 内容不符合要求
INFO     生成虚假的msToken
ERROR    解析
         https://www.tiktok.com/api/user/detail/?WebIdLastTime=*****&aid=****&app_language=zh-Hans&
         app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_pla
         tform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2         F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F119.0.0.0%20Safari%2F537.36&channel=tiktok_w         eb&cookie_enabled=true&device_id=*******&device_platform=web_pc&focus_state=true&fr         om_page=user&history_len=4&is_fullscreen=false&is_page_visible=true&language=zh-Hans&os=windows         &priority_region=&referer=&region=SG&root_referer=https%3A%2F%2Fwww.tiktok.com%2F&screen_height         =1080&screen_width=1920&webcast_language=zh-Hans&tz_name=Asia%2FHong_Kong&msToken=1VlvmMfNmSIkS         vlIOMQj53-80ZC4nrhj7xbm16bpPFoSkA2v0RTekOAKNRggonqy-IbLLW54mw+hEVyfvkJMbDXLuGZ01wmkbJVEhHWtE7C4         c6tN8vGVjfXKl-qicgxqXbUKoJdKsxoRX0BMrH==&secUid=********* 接口 JSON 失败:  
         Expecting property name enclosed in double quotes: line 2 column 5 (char 6)
请前往QA文档 https://johnserf-seed.github.io/f2/question-answer/qa.html 查看相关帮助
ERROR    API内容请求失败,请更换新cookie后再试

还有就是观察到这个错误:缺乏URL参数,详情看命令帮助。

(douyin) PS C:\Users\***i\Downloads\TikTokDownload> f2 tk --auto-cookie firefox
INFO     App: tiktok
是否要使用命令行的参数更新配置文件?`C:\Users\***\Downloads\TikTokDownload\douyin\Lib\site-packages\f2\conf\app.yaml` [Y/n]: Y
配置文件已更新!
INFO     主配置路径:C:\Users\***\Downloads\TikTokDownload\douyin\Lib\site-packages\f2\conf\app.yaml    
INFO     自定义配置路径:C:\Users\***\Downloads\TikTokDownload\douyin\Lib\site-packages\f2\conf\app.yaml
ERROR    缺乏URL参数,详情看命令帮助

@Johnserf-Seed
Copy link
Owner

@Johnserf-Seed , 我按着你所指导的方法复制了开发者工具中的msToken,并且替换了\Lib\site-packages\f2\conf\conf.yaml中的两处msToken,还是看到了相同的错误。让我有点儿迷惑的是错误信息里的msToken并不是conf.yaml中的值。

我没有用代理。请帮忙指点有什么设置可能出了问题。我只是不能下载tiktok,可以下载抖音。 2 new

ERROR    msToken API错误:msToken 内容不符合要求
INFO     生成虚假的msToken
ERROR    解析
         https://www.tiktok.com/api/user/detail/?WebIdLastTime=*****&aid=****&app_language=zh-Hans&
         app_name=tiktok_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_pla
         tform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20Win64%3B%20x64%29%20AppleWebKit%2         F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F119.0.0.0%20Safari%2F537.36&channel=tiktok_w         eb&cookie_enabled=true&device_id=*******&device_platform=web_pc&focus_state=true&fr         om_page=user&history_len=4&is_fullscreen=false&is_page_visible=true&language=zh-Hans&os=windows         &priority_region=&referer=&region=SG&root_referer=https%3A%2F%2Fwww.tiktok.com%2F&screen_height         =1080&screen_width=1920&webcast_language=zh-Hans&tz_name=Asia%2FHong_Kong&msToken=1VlvmMfNmSIkS         vlIOMQj53-80ZC4nrhj7xbm16bpPFoSkA2v0RTekOAKNRggonqy-IbLLW54mw+hEVyfvkJMbDXLuGZ01wmkbJVEhHWtE7C4         c6tN8vGVjfXKl-qicgxqXbUKoJdKsxoRX0BMrH==&secUid=********* 接口 JSON 失败:  
         Expecting property name enclosed in double quotes: line 2 column 5 (char 6)
请前往QA文档 https://johnserf-seed.github.io/f2/question-answer/qa.html 查看相关帮助
ERROR    API内容请求失败,请更换新cookie后再试

还有就是观察到这个错误:缺乏URL参数,详情看命令帮助。

(douyin) PS C:\Users\***i\Downloads\TikTokDownload> f2 tk --auto-cookie firefox
INFO     App: tiktok
是否要使用命令行的参数更新配置文件?`C:\Users\***\Downloads\TikTokDownload\douyin\Lib\site-packages\f2\conf\app.yaml` [Y/n]: Y
配置文件已更新!
INFO     主配置路径:C:\Users\***\Downloads\TikTokDownload\douyin\Lib\site-packages\f2\conf\app.yaml    
INFO     自定义配置路径:C:\Users\***\Downloads\TikTokDownload\douyin\Lib\site-packages\f2\conf\app.yaml
ERROR    缺乏URL参数,详情看命令帮助

除了msToken值以外还包括这次请求的负载。
image

0.0.1.6-pw2版本已发布,更新即可。

@iDataist
Copy link

iDataist commented Jul 2, 2024

@Johnserf-Seed, 多谢答复。已经安装了“0.0.1.6-pw2” (pip install git+https://github.com/Johnserf-Seed/[email protected])。执行 f2 tk --auto-cookie firefoxf2/conf/app.yaml如下。请帮忙指点是哪出了问题。

tiktok:
  cookie: ak_bmsc=***~***~***; bm_sv=***~***; cmpl_token=***; msToken=***;
    multi_sids=***; odin_tt=***;
    passport_auth_status=***; passport_auth_status_ss=***;
    passport_csrf_token=***; passport_csrf_token_default=***;
    sessionid=***; sessionid_ss=***;
    sid_guard=***;
    sid_tt=***; sid_ucp_v1=***;
    ssid_ucp_v1=***;
    store-country-code=***; store-country-code-src=***; store-idc=***; tt-target-idc=***;
    tt-target-idc-sign=***;
    tt_chain_token=***; tt_csrf_token=***;
    ttwid=***;
    uid_tt=***; uid_tt_ss=***;
    passport_fe_beating_status=***; tiktok_webapp_theme=***; tiktok_webapp_theme_auto_dark_ab=***;
    last_login_method=***
  cover: false
  desc: false
  folderize: false
  interval: all
  lyric: false
  max_connections: 5
  max_counts: 0
  max_retries: 5
  max_tasks: 10
  mode: post
  music: false
  naming: '{create}_{aweme_id}'
  page_counts: 20
  path: Download
  timeout: 10

抖音下载依旧正常。Tiktok还是不能下载,我没有用代理或者VPN,Tiktok登录正常。

ERROR    HTTP状态错误, 尝试GET请求失败:                                                                                                         
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/o82MXJiNTi2eMSqfglErQ8Yf4TfcyQAXVaeMA8/?a=1988
         &bti=ODszNWYuMDE6&ch=0&cr=3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=734&bt=367&cs=0&ds=6&ft=4KJMyMzm8Zmo0mPfK-4jVZ_edpWrKsd.&mime_type=vide
         o_mp4&qs=0&rc=cnF8b2hsc2d3SkBwaHIxaDFybndmNWc6ZWg0NDU8ZjY7NTg3NUBpMzZrdHg5cmVuczMzZjczM0BjRl5Nc3FePmJKYSNvYF90aHFmOiMuYS0wYDViNjUxYWMvY
         zI1YSMwY2tsMmRzcWNgLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719973129&l=202407022018377735B7B21D54990BFF93&ply_type=2&policy=2&signature
         =43dde3d1d4d04aa65143f38e1d330d6e&tk=tt_chain_token, 错误详情: Client error '403 Forbidden' for url                                    
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/o82MXJiNTi2eMSqfglErQ8Yf4TfcyQAXVaeMA8/?a=198
         8&bti=ODszNWYuMDE6&ch=0&cr=3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=734&bt=367&cs=0&ds=6&ft=4KJMyMzm8Zmo0mPfK-4jVZ_edpWrKsd.&mime_type=vid
         eo_mp4&qs=0&rc=cnF8b2hsc2d3SkBwaHIxaDFybndmNWc6ZWg0NDU8ZjY7NTg3NUBpMzZrdHg5cmVuczMzZjczM0BjRl5Nc3FePmJKYSNvYF90aHFmOiMuYS0wYDViNjUxYWMv
         YzI1YSMwY2tsMmRzcWNgLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719973129&l=202407022018377735B7B21D54990BFF93&ply_type=2&policy=2&signatur
         e=43dde3d1d4d04aa65143f38e1d330d6e&tk=tt_chain_token'
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403

image

@qq517739813
Copy link
Author

感谢作者的无私回复,但是我这里更新msToken后和magec的依然无法爬取tk的视频,已经是根据多方查阅但是不能解决,期望作者回复
Uploading 修改图.png…

@qq517739813
Copy link
Author

修改图

@Johnserf-Seed
Copy link
Owner

@Johnserf-Seed, 多谢答复。已经安装了“0.0.1.6-pw2” (pip install git+https://github.com/Johnserf-Seed/[email protected])。执行%E3%80%82%E6%89%A7%E8%A1%8C) f2 tk --auto-cookie firefoxf2/conf/app.yaml如下。请帮忙指点是哪出了问题。

tiktok:
  cookie: ak_bmsc=***~***~***; bm_sv=***~***; cmpl_token=***; msToken=***;
    multi_sids=***; odin_tt=***;
    passport_auth_status=***; passport_auth_status_ss=***;
    passport_csrf_token=***; passport_csrf_token_default=***;
    sessionid=***; sessionid_ss=***;
    sid_guard=***;
    sid_tt=***; sid_ucp_v1=***;
    ssid_ucp_v1=***;
    store-country-code=***; store-country-code-src=***; store-idc=***; tt-target-idc=***;
    tt-target-idc-sign=***;
    tt_chain_token=***; tt_csrf_token=***;
    ttwid=***;
    uid_tt=***; uid_tt_ss=***;
    passport_fe_beating_status=***; tiktok_webapp_theme=***; tiktok_webapp_theme_auto_dark_ab=***;
    last_login_method=***
  cover: false
  desc: false
  folderize: false
  interval: all
  lyric: false
  max_connections: 5
  max_counts: 0
  max_retries: 5
  max_tasks: 10
  mode: post
  music: false
  naming: '{create}_{aweme_id}'
  page_counts: 20
  path: Download
  timeout: 10

抖音下载依旧正常。Tiktok还是不能下载,我没有用代理或者VPN,Tiktok登录正常。

ERROR    HTTP状态错误, 尝试GET请求失败:                                                                                                         
         https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/o82MXJiNTi2eMSqfglErQ8Yf4TfcyQAXVaeMA8/?a=1988
         &bti=ODszNWYuMDE6&ch=0&cr=3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=734&bt=367&cs=0&ds=6&ft=4KJMyMzm8Zmo0mPfK-4jVZ_edpWrKsd.&mime_type=vide
         o_mp4&qs=0&rc=cnF8b2hsc2d3SkBwaHIxaDFybndmNWc6ZWg0NDU8ZjY7NTg3NUBpMzZrdHg5cmVuczMzZjczM0BjRl5Nc3FePmJKYSNvYF90aHFmOiMuYS0wYDViNjUxYWMvY
         zI1YSMwY2tsMmRzcWNgLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719973129&l=202407022018377735B7B21D54990BFF93&ply_type=2&policy=2&signature
         =43dde3d1d4d04aa65143f38e1d330d6e&tk=tt_chain_token, 错误详情: Client error '403 Forbidden' for url                                    
         'https://v16-webapp-prime.us.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c001-euttp/o82MXJiNTi2eMSqfglErQ8Yf4TfcyQAXVaeMA8/?a=198
         8&bti=ODszNWYuMDE6&ch=0&cr=3&dr=0&lr=all&cd=0%7C0%7C0%7C&cv=1&br=734&bt=367&cs=0&ds=6&ft=4KJMyMzm8Zmo0mPfK-4jVZ_edpWrKsd.&mime_type=vid
         eo_mp4&qs=0&rc=cnF8b2hsc2d3SkBwaHIxaDFybndmNWc6ZWg0NDU8ZjY7NTg3NUBpMzZrdHg5cmVuczMzZjczM0BjRl5Nc3FePmJKYSNvYF90aHFmOiMuYS0wYDViNjUxYWMv
         YzI1YSMwY2tsMmRzcWNgLS1kMWNzcw%3D%3D&btag=e00088000&expire=1719973129&l=202407022018377735B7B21D54990BFF93&ply_type=2&policy=2&signatur
         e=43dde3d1d4d04aa65143f38e1d330d6e&tk=tt_chain_token'
         For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403

image

可以参考
qa: https://johnserf-seed.github.io/f2/question-answer/qa.html#tiktok-403-forbidden
issue: Johnserf-Seed/f2#79

@Johnserf-Seed
Copy link
Owner

修改图

可以更新到0.0.1.6版本

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) 已确认(confirmed) 该issue已被处理,将在下次推送中更新(The issue has been processed and will be updated in the next push)
Projects
None yet
Development

No branches or pull requests

3 participants