Set default Plex port

This commit is contained in:
Koha9 2025-06-20 22:27:01 +09:00
parent aa4223b413
commit 75a413667d
5 changed files with 5 additions and 4 deletions

View File

@ -15,6 +15,7 @@ PlexPlaylistSync 是一个用于同步 Plex 播放列表和本地 `.m3u`/`.m3u8`
### Token 登录
首次登录时使用用户名和密码连接 Plex 服务器,成功后程序会将获得的 `token` 保存在配置文件中,后续通信仅使用该 `token`,不再保存明文密码。
默认情况下 Plex 服务器使用 `32400` 端口,可在未修改服务器端口时直接使用该默认值。
## 安装

View File

@ -2,6 +2,6 @@
"theme": "light",
"token": "",
"server_url": "",
"server_port": "",
"server_port": "32400",
"library": ""
}

View File

@ -32,7 +32,7 @@ async def login(
user: str = Form(...),
pw: str = Form(...),
url: str = Form(...),
port: str = Form(...),
port: str = Form("32400"),
library: str = Form(...)
):
config = load_config()

View File

@ -19,7 +19,7 @@
</div>
<div class="mb-3">
<label for="port" class="form-label">端口</label>
<input type="text" class="form-control" id="port" name="port" placeholder="32400">
<input type="text" class="form-control" id="port" name="port" value="32400">
</div>
<div class="mb-3">
<label for="library" class="form-label">选择库</label>

View File

@ -2,7 +2,7 @@ from plexapi.myplex import MyPlexAccount
from plexapi.server import PlexServer
def connect_plex(config, username, password, url, port, library):
def connect_plex(config, username, password, url, port="32400", library=""):
"""Return a connected PlexServer instance and update config with token and server info."""
token = config.get("token")
if not token: