自动过滤隐藏文件

This commit is contained in:
岛风 2024-02-21 13:45:16 +08:00
parent 4fa7175832
commit 4d9a38ad68
1 changed files with 2 additions and 2 deletions

View File

@ -45,9 +45,9 @@ def main():
# 固定的base_url值
base_url = 'https://link.kite.kim/feng'
# 获取当前目录下的所有文件名,排除此脚本文件
# 获取当前目录下的所有文件名,排除此脚本文件和隐藏文件
current_script = os.path.basename(__file__)
file_names = [f for f in os.listdir('.') if os.path.isfile(f) and f != current_script]
file_names = [f for f in os.listdir('.') if os.path.isfile(f) and f != current_script and not f.startswith('.')]
# 生成URL链接
urls = generate_urls(file_names, base_url, args.dir)