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]抖音下载的视频封面不对 #291

Open
2 tasks done
androiddisk opened this issue Mar 6, 2025 · 4 comments
Open
2 tasks done

[BUG]抖音下载的视频封面不对 #291

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

Comments

@androiddisk
Copy link

androiddisk commented Mar 6, 2025

详细描述错误
使用命令行:f2 douyin --url https://www.douyin.com/video/7475253207439133992 --mode one --cover true --cookie xxx
下载的视频的封面是错误的 有的是封面和实际对不上,有的甚至是一张全黑的图片
黑屏封面:
https://www.douyin.com/video/7288655780595748132
https://www.douyin.com/video/7332426453704789299
封面和实际封面不一样
https://www.douyin.com/video/7475253207439133992

这个网站解析的封面和抖音的是一致的
https://3g.gljlw.com/diy/douyin.php

@androiddisk androiddisk added the 故障(bug) 代码问题导致的错误(Bugs caused by code problems) label Mar 6, 2025
Copy link

github-actions bot commented Mar 6, 2025

Copy link

dosubot bot commented Mar 6, 2025

@androiddisk Hello there! 👋 I'm here to help you with any bugs, questions, or contributions you have in mind. I'm Dosu, a bot designed to assist you while waiting for a human maintainer. Let's squash those bugs together!

I found two similar open issues related to TikTok downloads in the F2 repository, but neither has a solution in the comments:

  1. tiktok下载出错 [1]
  2. 抖音图文作品无法下载 [2]

Regarding your issue with incorrect video covers, F2 determines which cover image to associate with a downloaded TikTok video by checking for a dynamic cover URL first. If it exists, F2 downloads the animated cover as a .webp file. If the dynamic cover URL is not available, it checks for a static cover URL and downloads it as a .jpeg file. If neither is available, it logs a warning indicating that there is no cover for the video [3].

If the cover being downloaded is incorrect, it might be due to the URLs being incorrectly identified or an issue with the video data itself. You might want to check the logs for any warnings or errors related to cover downloads.

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

@androiddisk
Copy link
Author

androiddisk commented Mar 6, 2025

    aweme_data = await DouyinHandler(global_kwargs_tmp).fetch_one_video(aweme_id=aweme_id)
    aweme_dict = aweme_data._to_dict()
    print(f"aweme_id {aweme_dict["aweme_id"]}")
    print(f"cover {aweme_dict["cover"]}")
    print(f"cover {aweme_data._to_raw()["aweme_detail"]["video"]["cover"]}")
    print(f"origin_cover {aweme_data._to_raw()["aweme_detail"]["video"]["origin_cover"]}")
    print(f"cover_original_scale {aweme_data._to_raw()["aweme_detail"]["video"]["cover_original_scale"]}")
    print(f"dynamic_cover {aweme_data._to_raw()["aweme_detail"]["video"]["dynamic_cover"]}")

aweme_id 7288655780595748132
cover https://p9-pc-sign.douyinpic.com/tos-cn-p-0015/0a98961fe1fc401c923cec7e7b7607fd_1697022430~tplv-dy-360p.jpeg?lk3s=138a59ce&x-expires=1742450400&x-signature=efacFgxkNa0zc0oTFKSBeLBsDIk%3D&from=327834062&s=PackSourceEnum_AWEME_DETAIL&se=false&sc=origin_cover&biz_tag=pcweb_cover&l=20250306140645EBEADD767CBD2D15BDA8
cover {'height': 720, 'uri': 'image-cut-tos-priv/5e4798fd40d214efc16ea2bd8e5fb79e', 'url_list': ['https://p3-pc-sign.douyinpic.com/image-cut-tos-priv/5e4798fd40d214efc16ea2bd8e5fb79e~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2056600800&x-signature=YeD6unRbu1KMksz1YdKvpsK9UHc%3D&from=327834062&s=PackSourceEnum_AWEME_DETAIL&se=false&sc=cover&biz_tag=pcweb_cover&l=20250306140645EBEADD767CBD2D15BDA8', 'https://p9-pc-sign.douyinpic.com/image-cut-tos-priv/5e4798fd40d214efc16ea2bd8e5fb79e~tplv-dy-resize-origshort-autoq-75:330.jpeg?lk3s=138a59ce&x-expires=2056600800&x-signature=J2z5V28MfsYlW6ZSv4Be%2BJpgH4I%3D&from=327834062&s=PackSourceEnum_AWEME_DETAIL&se=false&sc=cover&biz_tag=pcweb_cover&l=20250306140645EBEADD767CBD2D15BDA8'], 'width': 720}
origin_cover {'height': 360, 'uri': 'tos-cn-p-0015/0a98961fe1fc401c923cec7e7b7607fd_1697022430', 'url_list': ['https://p9-pc-sign.douyinpic.com/tos-cn-p-0015/0a98961fe1fc401c923cec7e7b7607fd_1697022430~tplv-dy-360p.jpeg?lk3s=138a59ce&x-expires=1742450400&x-signature=efacFgxkNa0zc0oTFKSBeLBsDIk%3D&from=327834062&s=PackSourceEnum_AWEME_DETAIL&se=false&sc=origin_cover&biz_tag=pcweb_cover&l=20250306140645EBEADD767CBD2D15BDA8', 'https://p3-pc-sign.douyinpic.com/tos-cn-p-0015/0a98961fe1fc401c923cec7e7b7607fd_1697022430~tplv-dy-360p.jpeg?lk3s=138a59ce&x-expires=1742450400&x-signature=AzQ6PR%2BhvDjbjVlHcbOFWpmWdyI%3D&from=327834062&s=PackSourceEnum_AWEME_DETAIL&se=false&sc=origin_cover&biz_tag=pcweb_cover&l=20250306140645EBEADD767CBD2D15BDA8'], 'width': 480}
cover_original_scale {'height': 360, 'uri': 'tos-cn-i-0813/osCHENfgVnAdguAUAo8wA9lAAAJgfCvJI4bMmD', 'url_list': ['https://p3-pc-sign.douyinpic.com/tos-cn-i-0813/osCHENfgVnAdguAUAo8wA9lAAAJgfCvJI4bMmD~tplv-dy-360p.jpeg?lk3s=138a59ce&x-expires=1742450400&x-signature=tbJLR%2BEdecUktX4kwLEXrmqmJ5Y%3D&from=327834062&s=PackSourceEnum_AWEME_DETAIL&se=false&sc=origin_cover&biz_tag=pcweb_cover&l=20250306140645EBEADD767CBD2D15BDA8', 'https://p9-pc-sign.douyinpic.com/tos-cn-i-0813/osCHENfgVnAdguAUAo8wA9lAAAJgfCvJI4bMmD~tplv-dy-360p.jpeg?lk3s=138a59ce&x-expires=1742450400&x-signature=6i62mayXDuhx9Fmmy3YakpIIw94%3D&from=327834062&s=PackSourceEnum_AWEME_DETAIL&se=false&sc=origin_cover&biz_tag=pcweb_cover&l=20250306140645EBEADD767CBD2D15BDA8'], 'width': 480}
dynamic_cover {'height': 720, 'uri': 'tos-cn-i-0813/osCHENfgVnAdguAUAo8wA9lAAAJgfCvJI4bMmD', 'url_list': ['https://p3-pc-sign.douyinpic.com/obj/tos-cn-i-0813/osCHENfgVnAdguAUAo8wA9lAAAJgfCvJI4bMmD?lk3s=138a59ce&x-expires=1742450400&x-signature=s43sGAd79tyaecdsZZw7YCJnCIc%3D&from=327834062_large&s=PackSourceEnum_AWEME_DETAIL&se=false&sc=dynamic_cover&biz_tag=pcweb_cover&l=20250306140645EBEADD767CBD2D15BDA8', 'https://p9-pc-sign.douyinpic.com/obj/tos-cn-i-0813/osCHENfgVnAdguAUAo8wA9lAAAJgfCvJI4bMmD?lk3s=138a59ce&x-expires=1742450400&x-signature=CyrV591Q9UBDFHIn0QFDHK%2BIzx4%3D&from=327834062_large&s=PackSourceEnum_AWEME_DETAIL&se=false&sc=dynamic_cover&biz_tag=pcweb_cover&l=20250306140645EBEADD767CBD2D15BDA8'], 'width': 720}

似乎大佬用的 cover 是来自于["aweme_detail"]["video"]["origin_cover"]["url_list"][0] 这个资源点应该是不对的,感觉是视频第一个帧的截图 不是抖音上看到的封面

其中["aweme_detail"]["video"]["dynamic_cover"]["url_list"][1] 的封面是最大的 但是过于大了 我觉得["aweme_detail"]["video"]["dynamic_cover"]["url_list"][0] 比较合适 大佬以为呢

@Johnserf-Seed
Copy link
Owner

Johnserf-Seed commented Mar 6, 2025

cover与raw_cover 是上传时指定的封面
origin_cover 是视频第一帧,所以那2个作品是“黑”的
dynamic_cover与animated_cover 是完整大小的cover封面,如果开启动态封面则是gif
gaussian_cover 是模糊背景封面

后面更新一下cover这个参数,可以自己指定不同类型的封面

@Johnserf-Seed Johnserf-Seed added the 已确认(confirmed) 该issue已被处理,将在下次推送中更新(The issue has been processed and will be updated in the next push) label Mar 6, 2025
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

2 participants