GoForum🌐 V2EX

yt-dlp 如何下载抖音视频

liudon · 2026-06-03 15:18 · 0 次点赞 · 2 条回复
yt-dlp https://www.douyin.com/video/6963263655114722595 --cookies-from-browser chrome

通过 yt-dlp 下载抖音视频,已经加上使用浏览器 cookie 了,但还是报下面这个错误

WARNING: [Douyin] 6963263655114722595: Failed to parse JSON: Expecting value in '': line 1 column 1 (char 0)
ERROR: [Douyin] 6963263655114722595: Fresh cookies (not necessarily logged in) are needed; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "/opt/homebrew/Cellar/yt-dlp/2026.3.17_2/libexec/lib/python3.14/site-packages/yt_dlp/extractor/common.py", line 765, in extract
    ie_result = self._real_extract(url)
  File "/opt/homebrew/Cellar/yt-dlp/2026.3.17_2/libexec/lib/python3.14/site-packages/yt_dlp/extractor/tiktok.py", line 1484, in _real_extract
    raise ExtractorError(
        'Fresh cookies (not necessarily logged in) are needed',
        expected=not self._get_cookies(self._WEBPAGE_HOST).get('s_v_web_id'))

不知道是不是我使用的姿势不对,请教各位指点下。

2 条回复
bgm004 · 2026-06-03 15:38
#1

抖音视频不是一堆脚本吗。不是一定要 yt-dlp

duuu · 2026-06-03 15:43
#2

yt-dlp 有问题,我现在使用的方案是:

  1. 用 Playwright 打开抖音分享链接。
  2. 监听页面请求,抓 aweme/v1/web/aweme/detail 这类接口返回。
  3. 保存 api_response.json / metadata.json 。
  4. 从接口数据里拿真实视频播放地址。
  5. 再下载 MP4
添加回复
你还需要 登录 后发表回复

登录后可发帖和回复

登录 注册
主题信息
作者: liudon
发布: 2026-06-03
点赞: 0
回复: 0