提交config.json模板文件
This commit is contained in:
parent
69573f3fa4
commit
27e9d92a0a
28
config-example.json
Normal file
28
config-example.json
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"hardware": "L07A",
|
||||||
|
"account": "",
|
||||||
|
"password": "",
|
||||||
|
"mi_did": "",
|
||||||
|
"cookie": "",
|
||||||
|
"verbose": false,
|
||||||
|
"music_path": "music",
|
||||||
|
"conf_path": null,
|
||||||
|
"hostname": "192.168.2.5",
|
||||||
|
"port": 8090,
|
||||||
|
"proxy": null,
|
||||||
|
"search_prefix": "ytsearch:",
|
||||||
|
"ffmpeg_location": "./ffmpeg/bin",
|
||||||
|
"active_cmd": "play,random_play,playlocal,play_music_list,stop",
|
||||||
|
"exclude_dirs": "@eaDir",
|
||||||
|
"music_path_depth": 10,
|
||||||
|
"disable_httpauth": true,
|
||||||
|
"httpauth_username": "admin",
|
||||||
|
"httpauth_password": "admin",
|
||||||
|
"music_list_url": "",
|
||||||
|
"music_list_json": "",
|
||||||
|
"disable_download": false,
|
||||||
|
"use_music_api": false,
|
||||||
|
"log_file": "/tmp/xiaomusic.txt",
|
||||||
|
"fuzzy_match_cutoff": 0.6,
|
||||||
|
"enable_fuzzy_match": true
|
||||||
|
}
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass,asdict
|
||||||
|
|
||||||
from xiaomusic.utils import validate_proxy
|
from xiaomusic.utils import validate_proxy
|
||||||
|
|
||||||
@ -107,6 +107,11 @@ class Config:
|
|||||||
keywords_stop = os.getenv("XIAOMUSIC_KEYWORDS_STOP", "关机,暂停,停止")
|
keywords_stop = os.getenv("XIAOMUSIC_KEYWORDS_STOP", "关机,暂停,停止")
|
||||||
self.append_keyword(keywords_stop, "stop")
|
self.append_keyword(keywords_stop, "stop")
|
||||||
|
|
||||||
|
# 保存配置到 config-example.json 文件
|
||||||
|
#with open("config-example.json", "w") as f:
|
||||||
|
# data = asdict(self)
|
||||||
|
# json.dump(data, f, ensure_ascii=False, indent=4)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_options(cls, options: argparse.Namespace) -> Config:
|
def from_options(cls, options: argparse.Namespace) -> Config:
|
||||||
config = {}
|
config = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user