Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a feature for multi-user downloading #429

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions TikTokTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ def __init__(self):
if __name__ == '__main__':
# 获取命令行参数
cmd = Util.Command()
# 获取headers
headers = Util.Cookies(cmd.setting()).dyheaders
# 获取主页内容
profile = Util.Profile(headers)
# 使用参数并下载
profile.getProfile(cmd.setting())
for user in cmd.setting():
# 获取headers
headers = Util.Cookies(user).dyheaders
# 获取主页内容
profile = Util.Profile(headers)
# 使用参数并下载
profile.getProfile(user)

input('[ 完成 ]:已完成批量下载,输入任意键后退出:')
4 changes: 3 additions & 1 deletion Util/Command.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def setting(self):
self.update = args.update
print('[ 提示 ]:读取命令完成!\r')
Util.log.info('[ 提示 ]:读取命令完成!')
return [self.uid, self.music, self.mode, self.cookie, self.interval, self.update]
import ast
self.uid_list = ast.literal_eval(self.uid)
return [[f"[\"{uid}\"]", self.music, self.mode, self.cookie, self.interval, self.update] for uid in self.uid_list]


if __name__ == '__main__':
Expand Down
4 changes: 2 additions & 2 deletions conf.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[uid]
# 用户主页(非视频链接)
# 单视频请用TikTokDownload或TikTokWeb
uid = https://www.douyin.com/user/MS4wLjABAAAA3nckmLU8MKXB4Aao7ZOOLaHIRCJG5AzKMDRh_6WMkU4
uid = ["https://www.douyin.com/user/MS4wLjABAAAA3nckmLU8MKXB4Aao7ZOOLaHIRCJG5AzKMDRh_6WMkU4","https://www.douyin.com/user/MS4wLjABAAAA3nckmLU8MKXB4Aao7ZOOLaHIRCJG5AzKMDRh_6WMkU4"]

[music]
# 视频原声保存(yes|no)
Expand Down Expand Up @@ -30,4 +30,4 @@ interval = 0
[update]
# 选择是否自动更新(yes|no)
# 由于抖音频繁更新推荐开启此项
update = yes
update = yes