mirror of
https://github.com/JoeanAmier/XHS-Downloader.git
synced 2025-12-26 04:48:05 +08:00
refactor: 将端口从 8000 更改为 6666
- 修改了 app.py、Dockerfile、main.py 中的端口设置 - 更新了 README.md 和 README_EN.md 中的端口相关说明 - 调整了 API 文档的访问路径
This commit is contained in:
parent
14315e4657
commit
fca19144df
@ -15,6 +15,6 @@ RUN pip install --no-cache-dir -r /app/requirements.txt
|
||||
|
||||
VOLUME /app
|
||||
|
||||
EXPOSE 8000
|
||||
EXPOSE 6666
|
||||
|
||||
CMD ["python", "main.py"]
|
||||
|
||||
@ -83,8 +83,8 @@
|
||||
</ul>
|
||||
<li>创建容器</li>
|
||||
<ul>
|
||||
<li>TUI 模式:<code>docker run --name 容器名称(可选) -p 主机端口号:8000 -it joeanamier/xhs-downloader</code></li>
|
||||
<li>API 模式:<code>docker run --name 容器名称(可选) -p 主机端口号:8000 -it joeanamier/xhs-downloader python main.py server</code></li>
|
||||
<li>TUI 模式:<code>docker run --name 容器名称(可选) -p 主机端口号:6666 -it joeanamier/xhs-downloader</code></li>
|
||||
<li>API 模式:<code>docker run --name 容器名称(可选) -p 主机端口号:6666 -it joeanamier/xhs-downloader python main.py server</code></li>
|
||||
</ul>
|
||||
<li>运行容器
|
||||
<ul>
|
||||
@ -116,7 +116,7 @@
|
||||
<h1>🖥 服务器模式</h1>
|
||||
<p><b>启动:</b>运行命令:<code>python .\main.py server</code></p>
|
||||
<p><b>关闭:</b>按下 <code>Ctrl</code> + <code>C</code> 关闭服务器</p>
|
||||
<p>访问 <code>http://127.0.0.1:8000/docs</code>;你会看到自动生成的交互式 API 文档!</p>
|
||||
<p>访问 <code>http://127.0.0.1:6666/docs</code> 或者 <code>http://127.0.0.1:6666/redoc</code>;你会看到自动生成的交互式 API 文档!</p>
|
||||
<p><b>请求接口:</b><code>/xhs/</code></p>
|
||||
<p><b>请求方法:</b><code>POST</code></p>
|
||||
<p><b>请求格式:</b><code>JSON</code></p>
|
||||
@ -166,7 +166,7 @@
|
||||
<p><b>代码示例:</b></p>
|
||||
<pre>
|
||||
def api_demo():
|
||||
server = "http://127.0.0.1:8000/xhs/"
|
||||
server = "http://127.0.0.1:6666/xhs/"
|
||||
data = {
|
||||
"url": "https://www.xiaohongshu.com/explore/123456789",
|
||||
"download": True,
|
||||
|
||||
@ -84,8 +84,8 @@
|
||||
</ul>
|
||||
<li>Create Container</li>
|
||||
<ul>
|
||||
<li>TUI Mode: <code>docker run --name ContainerName(optional) -p HostPort:8000 -it joeanamier/xhs-downloader</code></li>
|
||||
<li>API Mode: <code>docker run --name ContainerName(optional) -p HostPort:8000 -it joeanamier/xhs-downloader python main.py server</code></li>
|
||||
<li>TUI Mode: <code>docker run --name ContainerName(optional) -p HostPort:6666 -it joeanamier/xhs-downloader</code></li>
|
||||
<li>API Mode: <code>docker run --name ContainerName(optional) -p HostPort:6666 -it joeanamier/xhs-downloader python main.py server</code></li>
|
||||
</ul>
|
||||
<li>Run Container
|
||||
<ul>
|
||||
@ -117,7 +117,7 @@
|
||||
<h1>🖥 Server Mode</h1>
|
||||
<p><b>Start:</b> Run the command: <code>python .\main.py server</code></p>
|
||||
<p><b>Stop:</b> Press <code>Ctrl</code> + <code>C</code> to stop the server</p>
|
||||
<p>Open <code>http://127.0.0.1:8000/docs</code>; you will see automatically generated interactive API documentation!</p>
|
||||
<p>Open <code>http://127.0.0.1:6666/docs</code> or <code>http://127.0.0.1:6666/redoc</code>; you will see automatically generated interactive API documentation!</p>
|
||||
<p><b>Request endpoint:</b>
|
||||
<code>/xhs/</code></p>
|
||||
<p><b>Request method:</b>
|
||||
@ -170,7 +170,7 @@
|
||||
<p><b>Code example:</b></p>
|
||||
<pre>
|
||||
def api_demo():
|
||||
server = "http://127.0.0.1:8000/xhs/"
|
||||
server = "http://127.0.0.1:6666/xhs/"
|
||||
data = {
|
||||
"url": "https://www.xiaohongshu.com/explore/123456789",
|
||||
"download": True,
|
||||
|
||||
2
main.py
2
main.py
@ -16,7 +16,7 @@ async def app():
|
||||
|
||||
async def server(
|
||||
host="0.0.0.0",
|
||||
port=8000,
|
||||
port=6666,
|
||||
log_level="info",
|
||||
):
|
||||
async with XHS(**Settings().run()) as xhs:
|
||||
|
||||
@ -475,7 +475,7 @@ class XHS:
|
||||
async def run_server(
|
||||
self,
|
||||
host="0.0.0.0",
|
||||
port=8000,
|
||||
port=6666,
|
||||
log_level="info",
|
||||
):
|
||||
self.server = FastAPI(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user