Skip to content

Commit

Permalink
🥊是否单独保存至文件夹
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnserf-Seed committed Aug 17, 2023
1 parent 896c317 commit ca295d3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Util/Download.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,12 @@ async def initiate_download(file_type: str, file_url: str, file_suffix: str, bas
# 获取文件的基础路径,这里的aweme['path']是到用户目录的绝对路径
base_path = aweme['path']
# 创建子目录名称
subdir_name = f'{ctime_f}_{aweme["desc"]}'
# 根据视频描述创建子目录
desc_path = Util.os.path.join(base_path, subdir_name)
subdir_name = await format_file_name(aweme, self.config['naming'])
# 如果folderize配置设置为'yes',则将作品单独保存为一个文件夹。
if self.config['folderize'].lower() == 'yes':
desc_path = Util.os.path.join(base_path, subdir_name)
else:
desc_path = base_path # 直接使用基础路径,不创建子目录
# 确保子目录存在,如果不存在,os.makedirs会自动创建
Util.os.makedirs(desc_path, exist_ok=True)

Expand Down

0 comments on commit ca295d3

Please sign in to comment.