Skip to content

Commit

Permalink
增加了没有配置文件自动生成
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnserfSeed authored and JohnserfSeed committed Jan 26, 2021
1 parent a03d422 commit 614172e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions TikTokMulti.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,29 @@ def download_all(self,count,author_list,video_list,aweme_id,nickname,dynamic_cov
return

def read_conf(self):
if os.path.isfile("conf.ini") == True:
pass
else:
print('....没有检测到配置文件,生成中....\r')
try:
cf = configparser.ConfigParser()
# 往配置文件写入内容
cf.add_section("url")
cf.set("url", "uid", "https://v.douyin.com/J7ECkmp/")
cf.add_section("music")
cf.set("music", "musicarg", "yes")
cf.add_section("count")
cf.set("count", "count", "10")
cf.add_section("save")
cf.set("save", "url", ".\\Download\\")
cf.add_section("mode")
cf.set("mode", "mode", "post")
with open("conf.ini","a+") as f:
cf.write(f)
print('....生成成功....')
except:
input('....生成失败,请前往GItHub下载配置文件....')
sys.exit()
#实例化读取配置文件
cf = configparser.ConfigParser()
#用utf-8防止出错
Expand Down

0 comments on commit 614172e

Please sign in to comment.