Skip to content

Commit

Permalink
发布 5.3 版本
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeanAmier committed Mar 2, 2024
1 parent 6deae86 commit cf720e1
Show file tree
Hide file tree
Showing 16 changed files with 288 additions and 119 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,14 @@

<p><b>🎥 点击图片观看演示视频,建议通过配置文件管理账号,更多介绍请查阅 <a href="https://github.com/JoeanAmier/TikTokDownloader/wiki/Documentation">文档</a></b></p>

[![演示视频](docs/程序运行演示.png)](https://www.bilibili.com/video/BV1Nu4y1L7LW/)
[![演示视频](docs/程序运行演示.png)](https://www.bilibili.com/video/BV1KH4y177Ev/)

# 📈 项目状态\(Status\)

* 🟢 经过测试,[Releases](https://github.com/JoeanAmier/TikTokDownloader/releases/latest) 发布的源码已经验证所有功能正常可用
* 🟡 TikTokDownloader 开发计划及进度可前往 [Projects](https://github.com/users/JoeanAmier/projects/2) 查阅
* 🔴 请注意,最新源码可能存在一些不稳定的 Bug
* 🔴 如果在使用过程中发现程序 Bug,请及时告知作者修复
* 🔴 采集 TikTok 图集作品导致异常退出,已修复
* 🔴 某些情况下读取 HTML 文件失败,已修复
* 🔴 夜晚无法下载高分辨率视频,疑似抖音服务端限制

# 📋 项目说明\(Instructions\)
Expand Down Expand Up @@ -125,7 +123,7 @@
<li>按照提示操作,将 Cookie 写入配置文件</li>
</ol>
</li>
<li>返回程序界面,依次选择 <code>终端交互模式</code> -> <code>批量下载链接作品(通用)</code></li>
<li>返回程序界面,依次选择 <code>终端交互模式</code> -> <code>批量下载链接作品(通用)</code> -> <code>手动输入待采集的作品链接</code></li>
<li>输入抖音或 TikTok 作品链接即可下载作品文件</li>
<li>更多详细说明请查看 <b><a href="https://github.com/JoeanAmier/TikTokDownloader/wiki/Documentation">项目文档</a></b></li>
</ol>
Expand Down Expand Up @@ -185,7 +183,7 @@
>
> ### 安装程序
>
>> **敬请期待!**
>> **直接使用安装程序覆盖安装。**
# ⚠️ 免责声明\(Disclaimers\)

Expand Down
32 changes: 27 additions & 5 deletions docs/TikTokDownloader文档.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<li>按照提示操作,将 Cookie 写入配置文件</li>
</ol>
</li>
<li>返回程序界面,依次选择 <code>终端交互模式</code> -> <code>批量下载链接作品(通用)</code></li>
<li>返回程序界面,依次选择 <code>终端交互模式</code> -> <code>批量下载链接作品(通用)</code> -> <code>手动输入待采集的作品链接</code></li>
<li>输入抖音或 TikTok 作品链接即可下载作品文件</li>
</ol>
<h1>获取 Cookie</h1>
Expand Down Expand Up @@ -105,17 +105,29 @@
<ul>
<li>账号/作品/直播完整链接:使用浏览器打开抖音或 TikTok 链接时,地址栏所显示的 URL 地址。</li>
<li>分享链接:点击 APP 或网页版的分享按钮得到的 URL 地址,抖音平台以 <code>https://v.</code> 开头,掺杂中文和其他字符;TikTok
平台以 <code>https://vm</code> 开头,不掺杂其他字符;使用时不需要手动去除中文和其他字符,程序会自动提取 URL 链接。</li>
平台以 <code>https://vm</code> 开头,不掺杂其他字符;使用时<b>不需要</b>手动去除中文和其他字符,程序会自动提取 URL 链接。</li>
</ul>
<h2>数据储存</h2>
<ul>
<li>配置文件 <code>settings.json</code> 的 <code>storage_format</code> 参数可设置数据储存格式类型,如果不设置该参数,程序不会储存任何数据至文件。</li>
<li><code>采集作品评论数据</code>、<code>批量采集账号数据</code>、<code>采集搜索结果数据</code>、<code>采集抖音热榜数据</code> 模式必须设置 <code>storage_format</code> 参数才能正常使用。</li>
<li>程序所有数据均储存至 <code>root</code> 参数路径下的 <code>Data</code> 文件夹。</li>
</ul>
<h2>文本文档</h2>
<p>项目部分功能支持从文本文档(TXT)读取链接,如需使用,请在计算机任意路径创建一个空白文本文档,然后编辑文件内容,每行输入单个链接,编辑完成后保存文件。</p>
<p>文本文档编码:UTF-8</p>
<h3>文本文档内容示例</h3>

```text
https://www.douyin.com/user/abcd?vid=123456789
https://www.douyin.com/search/key?modal_id=123456789
https://www.douyin.com/video/123456789
https://www.douyin.com/note/123456789
```

<h2>直播下载</h2>
<p><code>获取直播推流地址</code> 功能支持调用 <code>ffmpeg</code> 下载直播,程序会优先调用系统环境的 <code>ffmpeg</code>,其次调用 <code>ffmpeg</code> 参数指定的 <code>ffmpeg</code>,如果 <code>ffmpeg</code> 不可用,程序将会调用内置下载器下载直播。</p>
<p>建议配置 <code>ffmpeg</code> 环境,<code>ffmpeg.exe</code> 可前往 <a href="http://ffmpeg.org/download.html">官方网站</a> 获取。</p>
<p>建议配置 <code>ffmpeg</code> 环境,<code>ffmpeg.exe</code> 可前往 <a href="https://ffmpeg.org/download.html">官方网站</a> 获取。</p>
<h2>功能简介</h2>
<table>
<thead>
Expand Down Expand Up @@ -599,6 +611,7 @@ document.body.removeChild(downloadLink);
<ol>
<li>使用 <code>settings.json</code> 的 <code>accounts_urls</code> 参数中的账号链接。</li>
<li>手动输入待采集的账号链接;此选项仅支持批量下载账号发布页作品,暂不支持参数设置。</li>
<li>输入文本文档路径,读取文件包含的账号链接;此选项仅支持批量下载账号发布页作品,暂不支持参数设置。</li>
</ol>
<p>支持链接格式:</p>
<ul>
Expand All @@ -611,7 +624,11 @@ document.body.removeChild(downloadLink);
<p>处理多个账号时,如果某个账号获取数据失败,程序会询问用户是否继续处理(可编辑 <code>src/custom/function.py</code> 文件修改功能)</p>
<p>每个账号的作品会下载至 <code>root</code> 参数路径下的账号文件夹,账号文件夹格式为 <code>UID123456789_mark_类型</code> 或者 <code>UID123456789_账号昵称_类型</code></p>
<h3>批量下载链接作品</h3>
<p>输入作品链接;<strong>支持 TikTok 平台。</strong></p>
<p><strong>支持 TikTok 平台。</strong></p>
<ol>
<li>手动输入待采集的作品链接。</li>
<li>输入文本文档路径,读取文件包含的作品链接。</li>
</ol>
<p>支持链接格式:</p>
<ul>
<li><code>https://v.douyin.com/分享码/</code></li>
Expand Down Expand Up @@ -642,7 +659,10 @@ document.body.removeChild(downloadLink);
<li>直播视频会下载至 <code>root</code> 参数路径下的 <code>Live</code> 文件夹</li>
</ul>
<h3>采集作品评论数据</h3>
<p>输入作品链接。</p>
<ol>
<li>手动输入待采集的作品链接。</li>
<li>输入文本文档路径,读取文件包含的作品链接。</li>
</ol>
<p>支持链接格式:</p>
<ul>
<li><code>https://v.douyin.com/分享码/</code></li>
Expand All @@ -658,6 +678,7 @@ document.body.removeChild(downloadLink);
<ol>
<li>使用 <code>settings.json</code> 的 <code>mix_urls</code> 参数中的合集链接或作品链接。</li>
<li>输入合集链接,或者属于合集的任意一个作品链接。</li>
<li>输入文本文档路径,读取文件包含的作品链接或合集链接;该选项暂不支持设置合集标识。</li>
</ol>
<p>支持链接格式:</p>
<ul>
Expand All @@ -677,6 +698,7 @@ document.body.removeChild(downloadLink);
<ol>
<li>使用 <code>settings.json</code> 的 <code>accounts_urls</code> 参数中的账号链接。</li>
<li>手动输入待采集的账号链接。</li>
<li>输入文本文档路径,读取文件包含的账号链接。</li>
</ol>
<p>支持链接格式:</p>
<ul>
Expand Down
Binary file modified docs/WebUI模式截图2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/程序运行演示.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/终端交互模式截图1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/终端交互模式截图2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
requests>=2.31.0
openpyxl>=3.1.2
Flask>=3.0.0
Flask>=3.0.2
qrcode>=7.4.2
emoji>=2.8.0
rich>=13.6.0
lxml>=4.9.3
emoji>=2.10.1
rich>=13.7.1
lxml>=5.1.0
browser-cookie3>=0.19.1
8 changes: 6 additions & 2 deletions src/application/TikTokDownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ def inner(self, *args, **kwargs):


class TikTokDownloader:
REDUCED = (1, 1, 1, 1, 0, 1, 0, 0, 1, 1) # 禁用项目部分功能
# REDUCED = False # 启用项目全部功能

NAME = f"TikTokDownloader v{VERSION_MAJOR}.{
VERSION_MINOR}{" Beta" if VERSION_BETA else ""}"
WIDTH = 50
Expand Down Expand Up @@ -219,7 +222,7 @@ def check_update(self):
self.console.print("检测新版本失败", style=ERROR)
self.console.print()

def main_menu(self, default_mode=None):
def main_menu(self, default_mode=""):
"""选择运行模式"""
while self.running:
self.__update_menu()
Expand All @@ -237,7 +240,7 @@ def main_menu(self, default_mode=None):
@start_cookie_task
def complete(self):
"""终端交互模式"""
example = TikTok(self.parameter)
example = TikTok(self.parameter, self.REDUCED)
register(self.blacklist.close)
try:
example.run(self.default_mode)
Expand Down Expand Up @@ -319,6 +322,7 @@ def check_settings(self):
console=self.console,
**self.settings.read(),
blacklist=self.blacklist,
reduced=bool(self.REDUCED),
)
self.default_mode = self.parameter.default_mode.copy()
self.parameter.cleaner.set_rule(TEXT_REPLACEMENT, True)
Expand Down
4 changes: 2 additions & 2 deletions src/application/main_api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@


class APIServer(WebUI):
def __init__(self, parameter):
super().__init__(parameter)
def __init__(self, parameter, key=None):
super().__init__(parameter, key)

def _generate_record_params(self, data: dict, merge=True, **kwargs):
root, params, logger = self.record.run(self.parameter,
Expand Down
Loading

0 comments on commit cf720e1

Please sign in to comment.