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]0.0.1.7版本图片后缀默认是.webp,如何设置才能跟0.0.1.6版本一样默认是.jpg #283

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

Comments

@github2611
Copy link

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

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

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

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

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

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

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

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

系统平台

单击展开 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.5]

错误重现

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

A:

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

A:

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

A:

预期行为
简明扼要地描述期望发生的事情。

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

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

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

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

dosubot bot commented Feb 23, 2025

Hello, @github2611! 👋 I'm here to help you with any bugs, questions, or contributions you may have while waiting for a human maintainer. I'm Dosu, a bot designed to assist with all things code-related.

在 F2 的 0.0.1.7 版本中,图片默认格式变为 .webp。要将其更改为 .jpg,可以查看 download_images 方法的实现。在 f2/apps/douyin/dl.py 文件中,图片下载的格式被设置为 .webp

for i, image_url in enumerate(self.aweme_data_dict.get("images", [])):
    image_name = f"{format_file_name(self.kwargs.get('naming'), self.aweme_data_dict)}_image_{i + 1}"
    if image_url:
        await self.initiate_download(
            _("图集"), image_url, self.base_path, image_name, ".webp"
        )

要更改为 .jpg,可以尝试修改此代码段,将 ".webp" 改为 ".jpg"。不过,请注意,这可能需要对代码进行适当的测试以确保兼容性和功能性 [1].

如果没有直接的配置选项或命令行参数来更改默认格式,您可能需要手动修改代码或等待未来的更新来支持此功能。

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

旧版本的文件后缀是假格式,格式都是webp。可以自己转码

@github2611
Copy link
Author

Hello, @github2611! 👋 I'm here to help you with any bugs, questions, or contributions you may have while waiting for a human maintainer. I'm Dosu, a bot designed to assist with all things code-related.

在 F2 的 0.0.1.7 版本中,图片默认格式变为 .webp。要将其更改为 .jpg,可以查看 download_images 方法的实现。在 f2/apps/douyin/dl.py 文件中,图片下载的格式被设置为 .webp

for i, image_url in enumerate(self.aweme_data_dict.get("images", [])):
image_name = f"{format_file_name(self.kwargs.get('naming'), self.aweme_data_dict)}image{i + 1}"
if image_url:
await self.initiate_download(
_("图集"), image_url, self.base_path, image_name, ".webp"
)
要更改为 .jpg,可以尝试修改此代码段,将 ".webp" 改为 ".jpg"。不过,请注意,这可能需要对代码进行适当的测试以确保兼容性和功能性 [1].

如果没有直接的配置选项或命令行参数来更改默认格式,您可能需要手动修改代码或等待未来的更新来支持此功能。

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](https://app.dosu.dev/response-feedback/3e68fb07-2799-4c89-a772-32

Hello, @github2611! 👋 I'm here to help you with any bugs, questions, or contributions you may have while waiting for a human maintainer. I'm Dosu, a bot designed to assist with all things code-related.

在 F2 的 0.0.1.7 版本中,图片默认格式变为 .webp。要将其更改为 .jpg,可以查看 download_images 方法的实现。在 f2/apps/douyin/dl.py 文件中,图片下载的格式被设置为 .webp

for i, image_url in enumerate(self.aweme_data_dict.get("images", [])):
image_name = f"{format_file_name(self.kwargs.get('naming'), self.aweme_data_dict)}image{i + 1}"
if image_url:
await self.initiate_download(
_("图集"), image_url, self.base_path, image_name, ".webp"
)
要更改为 .jpg,可以尝试修改此代码段,将 ".webp" 改为 ".jpg"。不过,请注意,这可能需要对代码进行适当的测试以确保兼容性和功能性 [1].

如果没有直接的配置选项或命令行参数来更改默认格式,您可能需要手动修改代码或等待未来的更新来支持此功能。

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

问题解决了,非常感谢

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