Skip to content

Commit 7847c8c

Browse files
committed
fix: 修复 TikTok 平台批量下载合集作品功能
修复其他已知问题 Closes #599
1 parent f1b0fbd commit 7847c8c

File tree

8 files changed

+35
-24
lines changed

8 files changed

+35
-24
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<br>
1919
<p>🔥 <b>TikTok 发布/喜欢/合辑/直播/视频/图集/音乐;抖音发布/喜欢/收藏/收藏夹/视频/图集/实况/直播/音乐/合集/评论/账号/搜索/热榜数据采集工具:</b>完全开源,基于 HTTPX 模块实现的免费数据采集和文件下载工具;批量下载抖音账号发布、喜欢、收藏、收藏夹作品;批量下载 TikTok 账号发布、喜欢作品;下载抖音链接或 TikTok 链接作品;获取抖音直播推流地址;下载抖音直播视频;获取 TikTok 直播推流地址;下载 TikTok 直播视频;采集抖音作品评论数据;批量下载抖音合集作品;批量下载 TikTok 合辑作品;采集抖音账号详细数据;采集抖音用户 / 作品 / 直播搜索结果;采集抖音热榜数据。</p>
2020
<p>⭐ 本项目历史名称:<code>TikTokDownloader</code></p>
21+
<p>📣 本项目将于未来进行代码结构重构,目标是让代码更加稳健,并具备更好的可维护性与扩展性;如果你对项目设计、实现方式或优化思路有想法,欢迎提出建议或参与讨论!</p>
2122
<hr>
2223

2324
# 📝 项目功能

README_EN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<br>
1919
<p>🔥 <b>TikTok Posts/Liked/Mix/Live/Video/Image/Music; DouYin Posts/Liked/Favorites/Collections/Video/Image/LivePhoto/Live/Music/Mix/Comments/Account/Search/Hot Board Data Acquisition Tools:</b> Fully open-source, free data collection and file download tool based on HTTPX module implementation; batch download of DouYin account posts works, liked works, favorites works and collections works; batch download of TikTok account posts works and liked works; download of DouYin linked or TikTok linked works; obtain DouYin live stream addresses; download DouYin live stream video; obtain TikTok live stream addresses; download TikTok live stream video; collect DouYin works comments data; batch download of DouYin Mix works; batch download of TikTok Mix works; collect detailed data of DouYin accounts; collect DouYin user/works/live search results; collect DouYin Hot Board data.</p>
2020
<p>⭐ Previous project names: <code>TikTokDownloader</code></p>
21+
<p>📣 This project will undergo code structure refactoring in the future, with the goal of making the code more robust and providing better maintainability and extensibility. If you have any thoughts on project design, implementation methods, or optimization ideas, you are welcome to make suggestions or participate in discussions!</p>
2122
<p>⭐ Due to the author's limited energy, I was unable to update the English document in a timely manner, and the content may have become outdated, partial translation is machine translation, the translation result may be incorrect, Suggest referring to Chinese documentation. If you want to contribute to translation, we warmly welcome you.</p>
2223
<hr>
2324

docs/DouK-Downloader文档.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
</div>
1717
<br>
1818
<p>🔥 <b>TikTok 发布/喜欢/合辑/直播/视频/图集/音乐;抖音发布/喜欢/收藏/收藏夹/视频/图集/实况/直播/音乐/合集/评论/账号/搜索/热榜数据采集工具:</b>完全开源,基于 HTTPX 模块实现的免费数据采集和文件下载工具;批量下载抖音账号发布、喜欢、收藏、收藏夹作品;批量下载 TikTok 账号发布、喜欢作品;下载抖音链接或 TikTok 链接作品;获取抖音直播推流地址;下载抖音直播视频;获取 TikTok 直播推流地址;下载 TikTok 直播视频;采集抖音作品评论数据;批量下载抖音合集作品;批量下载 TikTok 合辑作品;采集抖音账号详细数据;采集抖音用户 / 作品 / 直播搜索结果;采集抖音热榜数据。</p>
19-
<p>⭐ <b>项目版本:<code>5.8 Beta</code>;文档更新日期:<code>2025/10/25</code></b></p>
19+
<p>⭐ <b>项目版本:<code>5.8 Beta</code>;文档更新日期:<code>2025/11/3</code></b></p>
2020
<p>⭐ <b>项目文档正在完善,如果发现任何错误或描述模糊之处,请告知作者以便改进!本项目历史名称:<code>TikTokDownloader</code></b></p>
21+
<p>⭐ Due to the author’s limited time and energy, the complete English documentation for this project is not yet available. If you wish to read the full documentation, we recommend using AI translation tools to assist your understanding. If you would like to contribute to the translation, your help is warmly welcomed.</p>
2122
<hr>
2223
<h1>快速入门</h1>
2324
<p>⭐ 本项目包含手动构建可执行文件的 GitHub Actions,使用者可以随时使用 GitHub Actions 将最新源码构建为可执行文件!</p>

docs/Release_Notes.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
2. 修复部分 TikTok 账号提取 sec_user_id 失败的问题
55
3. 修复 API 模式搜索接口多页数据报错的问题
66
4. 修复 API 模式搜索接口结果为空报错的问题
7-
5. 服务器模式默认启用局域网访问
8-
6. 更新数据接口请求参数
7+
5. 修复 TikTok 平台批量下载合集作品功能
8+
6. 服务器模式默认启用局域网访问
9+
7. 更新数据接口请求参数
10+
8. 修复其他已知问题

src/application/main_terminal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,6 +1695,7 @@ async def deal_mix_detail(
16951695
mix_data,
16961696
mode="mix",
16971697
mix_id=mix_obj.mix_id,
1698+
mix_title=mix_obj.mix_title,
16981699
mark=mark,
16991700
api=api,
17001701
tiktok=tiktok,

src/extract/extractor.py

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -896,24 +896,28 @@ def preprocessing_data(
896896
)
897897
return id_, name, mark
898898
case "mix":
899-
item = self.__select_item(
900-
data,
901-
mix_id,
902-
(self.extract_params_tiktok if tiktok else self.extract_params)[
903-
"mix_id"
904-
],
905-
)
906-
id_, name, mark = self.__extract_pretreatment_data(
907-
item,
908-
(self.extract_params_tiktok if tiktok else self.extract_params)[
909-
"mix_id"
910-
],
911-
(self.extract_params_tiktok if tiktok else self.extract_params)[
912-
"mix_title"
913-
],
914-
mark,
915-
mix_title,
916-
)
899+
if tiktok:
900+
id_ = mix_id
901+
name = self.cleaner.filter_name(
902+
mix_title,
903+
).strip()
904+
mark = self.cleaner.filter_name(
905+
mark,
906+
name,
907+
).strip()
908+
else:
909+
item = self.__select_item(
910+
data,
911+
mix_id,
912+
self.extract_params["mix_id"],
913+
)
914+
id_, name, mark = self.__extract_pretreatment_data(
915+
item,
916+
self.extract_params["mix_id"],
917+
self.extract_params["mix_title"],
918+
mark,
919+
mix_title,
920+
)
917921
return id_, name, mark
918922
case "collects":
919923
collect_name = self.cleaner.filter_name(

src/interface/mix_tiktok.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(
2828
# self.detail_id = detail_id # 未使用
2929
self.cursor = cursor
3030
self.count = count
31-
self.api = f"{self.domain}api/mix/item_list/"
31+
self.api = f"{self.domain}api/collection/item_list/"
3232
self.text = _("合辑作品")
3333

3434
def generate_params(
@@ -37,7 +37,8 @@ def generate_params(
3737
return self.params | {
3838
"count": self.count,
3939
"cursor": self.cursor,
40-
"mixId": self.mix_id,
40+
"collectionId": self.mix_id,
41+
"sourceType": "113",
4142
}
4243

4344
async def run(

src/link/extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class ExtractorTikTok(Extractor):
171171
account_link = compile(r"\S*?(https://www\.tiktok\.com/@[^\s/]+)\S*?")
172172

173173
detail_link = compile(
174-
r"\S*?https://www\.tiktok\.com/@[^\s/]+/(?!playlist)(?:(?:video|photo)/(\d{19}))?\S*?"
174+
r"\S*?https://www\.tiktok\.com/@[^\s/]+/(?!playlist|collection)(?:(?:video|photo)/(\d{19}))?\S*?"
175175
) # 作品链接
176176

177177
mix_link = compile(

0 commit comments

Comments
 (0)