增加搜狐视频弹幕下载并改进输入提示

This commit is contained in:
xhlove
2020-01-16 20:12:07 +08:00
parent 3cfccc1c3c
commit 986ec2b9fe
10 changed files with 302 additions and 30 deletions

View File

@@ -3,7 +3,7 @@
'''
# 作者: weimo
# 创建日期: 2020-01-04 19:17:44
# 上次编辑时间 : 2020-01-11 17:25:09
# 上次编辑时间 : 2020-01-16 20:06:23
# 一个人的命运啊,当然要靠自我奋斗,但是...
'''
import os
@@ -31,12 +31,16 @@ def write_lines_to_file(ass_head, lines, file_path):
for line in lines:
f.write(line + "\n")
def check_file(name, skip=False, fpath=os.getcwd()):
def check_file(name, args, fpath=os.getcwd()):
flag = True
file_path = os.path.join(fpath, name + ".ass")
if os.path.isfile(file_path):
if skip:
if args.y:
os.remove(file_path)
elif args.series:
# 存在重复的 那么直接pass认为已经下载好了
flag = False
return flag, file_path
else:
isremove = input("{}已存在,是否覆盖?(y/n)".format(file_path))
if isremove.strip() == "y":