Skip to content

Commit

Permalink
发布 2.1 版本
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeanAmier committed Jul 3, 2024
1 parent b87132e commit 3d28a6f
Show file tree
Hide file tree
Showing 13 changed files with 304 additions and 132 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM python:3.12.4-slim

LABEL name="XHS-Downloader" version="2.1 Beta" authors="JoeanAmier"
LABEL name="XHS-Downloader" version="2.1" authors="JoeanAmier"

COPY locale /locale
COPY source /source
COPY static /static
COPY LICENSE /LICENSE
COPY main.py /main.py
COPY README.md /README.md
COPY README_EN.md /README_EN.md
COPY requirements.txt /requirements.txt

RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt

EXPOSE 8000

CMD ["python", "main.py"]
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
<p>⭐ XHS-Downloader 开发计划及进度可前往 <a href="https://github.com/users/JoeanAmier/projects/5">Projects</a> 查阅</p>
<h1>📸 程序截图</h1>
<p><b>🎥 点击图片观看演示视频</b></p>
<a href="https://www.bilibili.com/video/BV1PJ4m1Y7Jt/"><img src="static/screenshot/程序运行截图CN1.png" alt=""></a>
<a href="https://www.bilibili.com/video/BV1H6421f7kT/"><img src="static/screenshot/程序运行截图CN1.png" alt=""></a>
<hr>
<a href="https://www.bilibili.com/video/BV1PJ4m1Y7Jt/"><img src="static/screenshot/程序运行截图CN2.png" alt=""></a>
<a href="https://www.bilibili.com/video/BV1H6421f7kT/"><img src="static/screenshot/程序运行截图CN2.png" alt=""></a>
<hr>
<a href="https://www.bilibili.com/video/BV1PJ4m1Y7Jt/"><img src="static/screenshot/程序运行截图CN3.png" alt=""></a>
<a href="https://www.bilibili.com/video/BV1H6421f7kT/"><img src="static/screenshot/程序运行截图CN3.png" alt=""></a>
<h1>🔗 支持链接</h1>
<ul>
<li><code>https://www.xiaohongshu.com/explore/作品ID</code></li>
Expand All @@ -59,11 +59,25 @@
<h1>🪟 关于终端</h1>
<p>⭐ 推荐使用 <a href="https://learn.microsoft.com/zh-cn/windows/terminal/install">Windows 终端</a> (Windows 11 默认终端)运行程序以便获得最佳显示效果!</p>
<h1>🥣 使用方法</h1>
<p>如果仅需下载无水印作品文件,建议选择 <b>程序运行</b>;如果有其他需求,建议选择 <b>源码运行</b>!</p>
<p>如果仅需下载无水印作品文件,建议选择 <b>程序运行</b> 或 <b>Docker 运行</b>;如果有其他需求,建议选择 <b>源码运行</b>!</p>
<p>建议自行设置 <code>cookie</code> 参数,若不设置该参数,程序功能可能无法正常使用!</p>
<h2>🖱 程序运行</h2>
<p>Windows 10 及以上用户可前往 <a href="https://github.com/JoeanAmier/XHS-Downloader/releases/latest">Releases</a> 下载程序压缩包,解压后打开程序文件夹,双击运行 <code>main.exe</code> 即可使用。</p>
<p>若通过此方式使用程序,文件默认下载路径为:<code>.\_internal\Download</code>;配置文件路径为:<code>.\_internal\settings.json</code></p>
<h2>⌨️ Docker 运行</h2>
<ol>
<li>获取镜像</li>
<ul>
<li>方式一:使用 <code>Dockerfile</code> 文件构建镜像</li>
<li>方式二:使用 <code>docker pull joeanamier/xhs-downloader</code> 命令拉取镜像</li>
</ul>
<li>创建容器</li>
<ul>
<li>TUI 模式:<code>docker run -it joeanamier/xhs-downloader:2.1</code></li>
<li>API 模式:<code>docker run -it joeanamier/xhs-downloader:2.1 python main.py server</code></li>
</ul>
</ol>
<p>Docker 运行项目时不支持 <b>命令行调用模式</b>,无法使用 <b>读取剪贴板</b> 与 <b>监听剪贴板</b> 功能,可以正常粘贴内容,其他功能如有异常请反馈!</p>
<h2>⌨️ 源码运行</h2>
<ol>
<li>安装版本号不低于 <code>3.12</code> 的 Python 解释器</li>
Expand Down Expand Up @@ -383,7 +397,7 @@ async def example():
</ul>
<b>在使用本项目的代码和功能之前,请您认真考虑并接受以上免责声明。如果您对上述声明有任何疑问或不同意,请不要使用本项目的代码和功能。如果您使用了本项目的代码和功能,则视为您已完全理解并接受上述免责声明,并自愿承担使用本项目的一切风险和后果。</b>

# 💡 代码参考
# 💡 项目参考

* https://github.com/encode/httpx/
* https://github.com/tiangolo/fastapi
Expand Down
399 changes: 277 additions & 122 deletions README_EN.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
textual>=0.70.0
textual<=0.63.0
pyperclip>=1.9.0
lxml>=5.2.2
PyYAML>=6.0.1
Expand Down
1 change: 1 addition & 0 deletions source/CLI/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def help_(ctx: Context, param, value) -> None:
table.add_column("type", no_wrap=True, style="bold")
table.add_column("description", no_wrap=True, )

# TODO: 语言设置未生效
options = (
("--url", "-u", "str", _("小红书作品链接")),
("--index", "-i", "str", _("下载指定序号的图片文件,仅对图文作品生效;多个序号输入示例:\"1 3 5 7\"")),
Expand Down
2 changes: 2 additions & 0 deletions source/module/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,14 @@ def __init__(
"Referer": "https://www.xiaohongshu.com/explore", },
timeout=timeout,
verify=False,
follow_redirects=True,
**self.proxy,
)
self.download_client = AsyncClient(
headers=self.blank_headers,
timeout=timeout,
verify=False,
follow_redirects=True,
**self.proxy,
)
self.image_download = self.check_bool(image_download, True)
Expand Down
2 changes: 1 addition & 1 deletion source/module/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

VERSION_MAJOR = 2
VERSION_MINOR = 1
VERSION_BETA = True
VERSION_BETA = False
ROOT = Path(__file__).resolve().parent.parent.parent
PROJECT = f"XHS-Downloader V{VERSION_MAJOR}.{
VERSION_MINOR}{" Beta" if VERSION_BETA else ""}"
Expand Down
Binary file modified static/screenshot/程序运行截图CN1.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 static/screenshot/程序运行截图CN2.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 static/screenshot/程序运行截图CN3.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 static/screenshot/程序运行截图EN1.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 static/screenshot/程序运行截图EN2.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 static/screenshot/程序运行截图EN3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3d28a6f

Please sign in to comment.