Skip to content

Commit 614172e

Browse files
增加了没有配置文件自动生成
1 parent a03d422 commit 614172e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

TikTokMulti.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,29 @@ def download_all(self,count,author_list,video_list,aweme_id,nickname,dynamic_cov
169169
return
170170

171171
def read_conf(self):
172+
if os.path.isfile("conf.ini") == True:
173+
pass
174+
else:
175+
print('....没有检测到配置文件,生成中....\r')
176+
try:
177+
cf = configparser.ConfigParser()
178+
# 往配置文件写入内容
179+
cf.add_section("url")
180+
cf.set("url", "uid", "https://v.douyin.com/J7ECkmp/")
181+
cf.add_section("music")
182+
cf.set("music", "musicarg", "yes")
183+
cf.add_section("count")
184+
cf.set("count", "count", "10")
185+
cf.add_section("save")
186+
cf.set("save", "url", ".\\Download\\")
187+
cf.add_section("mode")
188+
cf.set("mode", "mode", "post")
189+
with open("conf.ini","a+") as f:
190+
cf.write(f)
191+
print('....生成成功....')
192+
except:
193+
input('....生成失败,请前往GItHub下载配置文件....')
194+
sys.exit()
172195
#实例化读取配置文件
173196
cf = configparser.ConfigParser()
174197
#用utf-8防止出错

0 commit comments

Comments
 (0)