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

急求。Seed大佬,下载视频出现FileNotFoundError: [Errno 2] No such file or directory。感觉是{desc}参数太长导致。 #215

Closed
jo-sos opened this issue Dec 12, 2024 · 5 comments
Labels
故障(bug) 代码问题导致的错误(Bugs caused by code problems)

Comments

@jo-sos
Copy link

jo-sos commented Dec 12, 2024

下载的视频网址:https://www.douyin.com/user/MS4wLjABAAAAHulzlH6cETVMrnFTuEVrGb6GXcV6pw0S4uC4jQSTUyhnnFtuWs8zryKCcyaM9shm

屏幕截图

  • 操作系统: [e.g. Windows 11]
  • 浏览器 [Firefox]
  • 终端 [cmd命令]
  • F2版本 [0.0.1.6](更新到最新版了)

命令:
f2 dy --auto-cookie firefox

f2 dy -u https://www.douyin.com/user/MS4wLjABAAAAHulzlH6cETVMrnFTuEVrGb6GXcV6pw0S4uC4jQSTUyhnnFtuWs8zryKCcyaM9shm

配置文件内容:
douyin:
cookie:
cover: false
desc: no
folderize: false
interval: all
languages: zh_CN
max_connections: 5
max_counts: 0
max_retries: 4
max_tasks: 6
mode: post
music: false
naming: '{create}{desc}{nickname}'
page_counts: 20
path: ./Download
timeout: 6

我试了好多主页,名字短的是成功的。试了好多遍。发现,应该是视频的naming: '{create}{desc}{nickname}'原因,{desc}参数的名字太长导致视频文件名和目录路径太长了,才出现下载中途中断。大佬,觉得是这个原因吗?

请求:
在不解除Windows系统中文件名和目录路径的最大长度限制的情况下,如何修改程序中的参数来实现限制{desc}长度,能下载视频成功?具体在哪里修改程序,如何修改程序?麻烦大佬明示。急求。

@jo-sos jo-sos added the 故障(bug) 代码问题导致的错误(Bugs caused by code problems) label Dec 12, 2024
Copy link

dosubot bot commented Dec 12, 2024

Hello @jo-sos! I'm here to help you with any bugs, questions, or contributions you have. Let's squash those bugs together!

要限制 {desc} 参数的长度以避免文件名和目录路径过长的问题,您可以修改 format_file_name 函数的调用,设置一个合适的长度限制。例如,您可以将文件名的长度限制为 100 个字符:

print(
    format_file_name(
        kwargs.get("naming"), aweme_data._to_dict(), custom_fields, 100
    )
    + "_video"
)

您可以根据需要调整这个长度限制(例如 100)以确保文件名和目录路径的总长度不超过 Windows 的限制[1]

To continue talking to Dosu, mention @dosu.


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

Copy link

dosubot bot commented Dec 12, 2024

您可以在 f2 项目的代码中找到 format_file_name 函数。通常,这个函数会在处理文件命名的模块中定义。您可以尝试在项目的 snippets/douyin 目录下查找相关的 Python 文件,例如 format-file-name.py,因为这可能是定义或调用该函数的地方。

如果您使用的是本地克隆的代码库,可以使用搜索功能查找 format_file_name 函数的定义和调用位置。这样可以帮助您快速定位需要修改的代码文件。

To continue talking to Dosu, mention @dosu.


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

Copy link

dosubot bot commented Dec 12, 2024

format_file_name 函数可以在 f2.snippets.douyin.format-file-name 模块中找到。您可以查看 这个文件 来找到该函数的定义和使用位置[1].

To continue talking to Dosu, mention @dosu.


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

@jo-sos
Copy link
Author

jo-sos commented Dec 12, 2024

下载的视频网址:https://www.douyin.com/user/MS4wLjABAAAAHulzlH6cETVMrnFTuEVrGb6GXcV6pw0S4uC4jQSTUyhnnFtuWs8zryKCcyaM9shm

屏幕截图

  • 操作系统: [e.g. Windows 11]
  • 浏览器 [Firefox]
  • 终端 [cmd命令]
  • F2版本 [0.0.1.6](更新到最新版了)

命令: f2 dy --auto-cookie firefox

f2 dy -u https://www.douyin.com/user/MS4wLjABAAAAHulzlH6cETVMrnFTuEVrGb6GXcV6pw0S4uC4jQSTUyhnnFtuWs8zryKCcyaM9shm

配置文件内容: douyin: cookie: cover: false desc: no folderize: false interval: all languages: zh_CN max_connections: 5 max_counts: 0 max_retries: 4 max_tasks: 6 mode: post music: false naming: '{create}{desc}{nickname}' page_counts: 20 path: ./Download timeout: 6

我试了好多主页,名字短的是成功的。试了好多遍。发现,应该是视频的naming: '{create}{desc}{nickname}'原因,{desc}参数的名字太长导致视频文件名和目录路径太长了,才出现下载中途中断。大佬,觉得是这个原因吗?

请求: 在不解除Windows系统中文件名和目录路径的最大长度限制的情况下,如何修改程序中的参数来实现限制{desc}长度,能下载视频成功?具体在哪里修改程序,如何修改程序?麻烦大佬明示。急求。

@jo-sos jo-sos closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2024
@jo-sos jo-sos reopened this Dec 12, 2024
@Johnserf-Seed
Copy link
Owner

@jo-sos jo-sos closed this as completed Dec 12, 2024
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