Skip to content

Commit

Permalink
发布 5.0 版本
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeanAmier committed Nov 15, 2023
1 parent 6cf2c14 commit 81a4a7a
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 11 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
<br>
<p>🔥 <b>TikTok 视频/图集/原声;抖音主页/视频/图集/收藏/直播/原声/合集/评论/账号/搜索/热榜数据采集工具:</b>完全开源,基于 Requests 模块实现的免费工具;批量下载抖音账号发布、喜欢、收藏的作品;单独下载抖音链接或 TikTok 链接对应的作品;获取抖音直播推流地址;下载抖音直播视频;采集抖音作品评论数据;批量下载抖音合集作品;采集抖音账号详细数据;采集抖音用户 / 作品 / 直播搜索结果;采集抖音热榜数据。</p>
<p>⭐ Windows 10 及以上用户可前往 <a href="https://github.com/JoeanAmier/TikTokDownloader/releases/latest">Releases</a> 下载已编译的 exe 程序,开箱即用!</p>
<p>❤️ 作者仅在 GitHub 发布 TikTokDownloader,未与任何个人或网站合作,且没有任何收费计划!</p>
<hr>

# 📝 功能清单\(Function\)

* ✅ 下载抖音无水印视频/图集
* ✅ 下载 TikTok 无水印视频/图集
* ✅ 批量下载抖音账号发布/喜欢/收藏作品
* ✅ 采集抖音 / TikTok 详细数据
* ✅ 批量下载链接作品
* ✅ 多账号批量下载作品
* ✅ 自动跳过已下载的文件
Expand Down
14 changes: 14 additions & 0 deletions docs/TikTokDownloader文档.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,20 @@
```

<p>代表运行程序自动进入 <code>终端命令行模式</code>,其他示例:<code>4</code> 代表 <code>Web API 接口模式</code>,<code>5</code> 代表 <code>Web UI 交互模式</code>,<code>6</code> 代表 <code>服务器部署模式</code>。</p>

```json
{
"proxies": "http://127.0.0.1:9999"
}
```

<p>代表程序获取网络数据时使用 <code>http://127.0.0.1:9999</code> 作为代理;程序会自动验证代理是否可用,如果代理不可用,则 <code>proxies</code> 参数不生效。</p>
<p>如果您的电脑使用了代理工具且未修改默认端口,可以尝试以下设置:</p>
<ul>
<li>Clash: <code>http://127.0.0.1:7890</code></li>
<li>v2rayN: <code>http://127.0.0.1:10809</code></li>
</ul>

<h1>高级配置</h1>
<p>如果想要进一步修改程序功能,可以编辑 <code>src/Customizer.py</code> 文件,按照注释指引和实际需求进行自定义修改。</p>
<b>部分可自定义设置的功能:</b>
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class TikTokDownloader:
# print(PROJECT_ROOT) # 调试使用

VERSION = 5.0
STABLE = False
STABLE = True

REPOSITORY = "https://github.com/JoeanAmier/TikTokDownloader"
LICENCE = "GNU General Public License v3.0"
Expand Down
4 changes: 2 additions & 2 deletions src/Configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from requests import get

from src.CookieTool import Register
from src.Customizer import INFO, ERROR, GENERAL
from src.Customizer import INFO, ERROR
from src.DataExtractor import Extractor
# from src.Parameter import MsToken
from src.Parameter import TtWid
Expand Down Expand Up @@ -67,7 +67,7 @@ def __create(self) -> dict:
dump(self.__default, f, indent=4, ensure_ascii=False)
self.console.print(
"创建默认配置文件 settings.json 成功!\n请参考项目文档的快速入门部分,设置 Cookie 后重新运行程序!\n建议根据实际使用需求"
"修改配置文件 settings.json!\n", style=GENERAL)
"修改配置文件 settings.json!\n")
return self.__default

def read(self) -> dict:
Expand Down
13 changes: 6 additions & 7 deletions src/CookieTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from requests import get

from src.Customizer import ERROR
from src.Customizer import GENERAL
from src.Customizer import WARNING
from src.Customizer import check_login
from src.Parameter import TtWid
Expand All @@ -29,7 +28,7 @@ def run(self):
"""提取 Cookie 并写入配置文件"""
if not (
cookie := self.console.input(
f"[{GENERAL}]请粘贴 Cookie 内容:[/{GENERAL}]")):
"请粘贴 Cookie 内容: ")):
return
self.extract(cookie)

Expand Down Expand Up @@ -63,13 +62,13 @@ def extract(self, cookie: str, clean=True, return_=False):
if return_:
return keys
self.write(keys)
self.console.print("写入 Cookie 成功!", style=GENERAL)
self.console.print("写入 Cookie 成功!")

def check_key(self, items):
if not items["sessionid_ss"]:
self.console.print("当前 Cookie 未登录", style=GENERAL)
self.console.print("当前 Cookie 未登录")
else:
self.console.print("当前 Cookie 已登录", style=GENERAL)
self.console.print("当前 Cookie 已登录")
keys_to_remove = [key for key, value in items.items() if value is None]
for key in keys_to_remove:
del items[key]
Expand Down Expand Up @@ -141,7 +140,7 @@ def generate_dict(data: str) -> dict:

def generate_qr_code(self, url: str):
qr_code = QRCode()
assert url, "无效的登录二维码数据"
# assert url, "无效的登录二维码数据"
qr_code.add_data(url)
qr_code.make(fit=True)
qr_code.print_ascii(invert=True)
Expand Down Expand Up @@ -221,7 +220,7 @@ def get_cookie(self, url, cookie):

def wait(self):
sleep(2)
self.console.print("正在检查登录结果!", style=GENERAL)
self.console.print("正在检查登录结果!")

def request_data(self, json=True, **kwargs):
try:
Expand Down
2 changes: 1 addition & 1 deletion src/DataDownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def run_batch(
mid: str = None,
title: str = None,
):
assert addition in {"喜欢作品", "收藏作品", "发布作品", "合集作品"}, ValueError
# assert addition in {"喜欢作品", "收藏作品", "发布作品", "合集作品"}, ValueError
mix = addition == "合集作品"
root = self.storage_folder(
mid or id_,
Expand Down

0 comments on commit 81a4a7a

Please sign in to comment.