Skip to content

Commit

Permalink
优化配置文件的读取方式
Browse files Browse the repository at this point in the history
  • Loading branch information
x1ao4 authored Mar 13, 2024
1 parent d5cb4c6 commit 678ffe0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion zh/plex-scanner/plex-scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
import requests
import configparser
import xml.etree.ElementTree as ET
from pathlib import Path

# 定义配置文件路径
config_file: Path = Path(__file__).parent / 'config.ini'

# 读取配置文件
config = configparser.ConfigParser()
config.read('config.ini')
config.read(config_file)

# 获取服务器地址和 token
plex_server = config.get('server', 'address')
Expand Down

0 comments on commit 678ffe0

Please sign in to comment.