mirror of
https://github.com/hanxi/xiaomusic.git
synced 2025-12-09 15:18:15 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6de3dfd00 | ||
|
|
ae297c780a | ||
|
|
e07a06c8e4 | ||
|
|
1c91f39417 |
16
pdm.lock
generated
16
pdm.lock
generated
@@ -5,7 +5,7 @@
|
|||||||
groups = ["default"]
|
groups = ["default"]
|
||||||
strategy = ["cross_platform"]
|
strategy = ["cross_platform"]
|
||||||
lock_version = "4.4.1"
|
lock_version = "4.4.1"
|
||||||
content_hash = "sha256:ef2667ea2d19174a0be9e4d6442b8c749f0ac3be48bbccf5f604ee436aaf4d22"
|
content_hash = "sha256:3137b159cf24210912a6a3d16e6ae42511177b211996625fe6bdabebdaec230e"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aiohttp"
|
name = "aiohttp"
|
||||||
@@ -507,8 +507,8 @@ files = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miservice-fork"
|
name = "miservice-fork"
|
||||||
version = "2.4.4"
|
version = "2.5.0"
|
||||||
requires_python = ">=3.7"
|
requires_python = ">=3.8"
|
||||||
summary = "XiaoMi Cloud Service fork from https://github.com/Yonsm/MiService"
|
summary = "XiaoMi Cloud Service fork from https://github.com/Yonsm/MiService"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aiohttp",
|
"aiohttp",
|
||||||
@@ -516,8 +516,8 @@ dependencies = [
|
|||||||
"rich",
|
"rich",
|
||||||
]
|
]
|
||||||
files = [
|
files = [
|
||||||
{file = "miservice_fork-2.4.4-py3-none-any.whl", hash = "sha256:72aa5c13df290e1582104848743a2bda1bce8165e86f089c3a41d99835c70f13"},
|
{file = "miservice_fork-2.5.0-py3-none-any.whl", hash = "sha256:97b6360ea53c34fe035ac9d94e8705f305b8fa7fc2b44a7aea182449a76cb622"},
|
||||||
{file = "miservice_fork-2.4.4.tar.gz", hash = "sha256:381838c11c7f9a36fb358ad5bb9e2554975f91716897fa9395a5edf2014f6587"},
|
{file = "miservice_fork-2.5.0.tar.gz", hash = "sha256:8ca2d370d5b32f7e330add38aa1912d734aefa7880f16cef9eac110a5a3029e2"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -784,7 +784,7 @@ files = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "yt-dlp"
|
name = "yt-dlp"
|
||||||
version = "2024.5.13.232704.dev0"
|
version = "2024.5.16.232713.dev0"
|
||||||
requires_python = ">=3.8"
|
requires_python = ">=3.8"
|
||||||
summary = "A feature-rich command-line audio/video downloader"
|
summary = "A feature-rich command-line audio/video downloader"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
@@ -798,6 +798,6 @@ dependencies = [
|
|||||||
"websockets>=12.0",
|
"websockets>=12.0",
|
||||||
]
|
]
|
||||||
files = [
|
files = [
|
||||||
{file = "yt_dlp-2024.5.13.232704.dev0-py3-none-any.whl", hash = "sha256:3fa43b489ce80f1d065c6d15a389e4e7d553252069c54eb21e739a6921de5fe1"},
|
{file = "yt_dlp-2024.5.16.232713.dev0-py3-none-any.whl", hash = "sha256:42d3c27ab77583ff67ee2ddc94e376ea2a76a561ed8b1836ee04fd1cd23ad88c"},
|
||||||
{file = "yt_dlp-2024.5.13.232704.dev0.tar.gz", hash = "sha256:67f615650843a6663d1dc127f6367f0cc08ef515ea4fe96bbd8a00772743a8ca"},
|
{file = "yt_dlp-2024.5.16.232713.dev0.tar.gz", hash = "sha256:d431187fa703c9f52225080ae56471272679e44d9363f97b7b3187d37a5e6480"},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "xiaomusic"
|
name = "xiaomusic"
|
||||||
version = "0.1.30"
|
version = "0.1.32"
|
||||||
description = "Play Music with xiaomi AI speaker"
|
description = "Play Music with xiaomi AI speaker"
|
||||||
authors = [
|
authors = [
|
||||||
{name = "涵曦", email = "im.hanxi@gmail.com"},
|
{name = "涵曦", email = "im.hanxi@gmail.com"},
|
||||||
@@ -9,7 +9,7 @@ dependencies = [
|
|||||||
"rich>=13.6.0",
|
"rich>=13.6.0",
|
||||||
"requests>=2.31.0",
|
"requests>=2.31.0",
|
||||||
"aiohttp>=3.8.6",
|
"aiohttp>=3.8.6",
|
||||||
"miservice-fork>=2.4.4",
|
"miservice-fork>=2.5.0",
|
||||||
"mutagen>=1.47.0",
|
"mutagen>=1.47.0",
|
||||||
"yt-dlp>=2024.04.09",
|
"yt-dlp>=2024.04.09",
|
||||||
"flask[async]>=3.0.1",
|
"flask[async]>=3.0.1",
|
||||||
|
|||||||
@@ -302,9 +302,9 @@ MarkupSafe==2.1.4 \
|
|||||||
mdurl==0.1.2 \
|
mdurl==0.1.2 \
|
||||||
--hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \
|
--hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \
|
||||||
--hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba
|
--hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba
|
||||||
miservice-fork==2.4.4 \
|
miservice-fork==2.5.0 \
|
||||||
--hash=sha256:381838c11c7f9a36fb358ad5bb9e2554975f91716897fa9395a5edf2014f6587 \
|
--hash=sha256:8ca2d370d5b32f7e330add38aa1912d734aefa7880f16cef9eac110a5a3029e2 \
|
||||||
--hash=sha256:72aa5c13df290e1582104848743a2bda1bce8165e86f089c3a41d99835c70f13
|
--hash=sha256:97b6360ea53c34fe035ac9d94e8705f305b8fa7fc2b44a7aea182449a76cb622
|
||||||
multidict==6.0.4 \
|
multidict==6.0.4 \
|
||||||
--hash=sha256:01a3a55bd90018c9c080fbb0b9f4891db37d148a0a18722b42f94694f8b6d4c9 \
|
--hash=sha256:01a3a55bd90018c9c080fbb0b9f4891db37d148a0a18722b42f94694f8b6d4c9 \
|
||||||
--hash=sha256:0b1a97283e0c85772d613878028fec909f003993e1007eafa715b24b377cb9b8 \
|
--hash=sha256:0b1a97283e0c85772d613878028fec909f003993e1007eafa715b24b377cb9b8 \
|
||||||
@@ -466,6 +466,6 @@ yarl==1.9.2 \
|
|||||||
--hash=sha256:d4e2c6d555e77b37288eaf45b8f60f0737c9efa3452c6c44626a5455aeb250b9 \
|
--hash=sha256:d4e2c6d555e77b37288eaf45b8f60f0737c9efa3452c6c44626a5455aeb250b9 \
|
||||||
--hash=sha256:e9fdc7ac0d42bc3ea78818557fab03af6181e076a2944f43c38684b4b6bed8e3 \
|
--hash=sha256:e9fdc7ac0d42bc3ea78818557fab03af6181e076a2944f43c38684b4b6bed8e3 \
|
||||||
--hash=sha256:ee4afac41415d52d53a9833ebae7e32b344be72835bbb589018c9e938045a560
|
--hash=sha256:ee4afac41415d52d53a9833ebae7e32b344be72835bbb589018c9e938045a560
|
||||||
yt-dlp==2024.5.13.232704.dev0 \
|
yt-dlp==2024.5.16.232713.dev0 \
|
||||||
--hash=sha256:3fa43b489ce80f1d065c6d15a389e4e7d553252069c54eb21e739a6921de5fe1 \
|
--hash=sha256:42d3c27ab77583ff67ee2ddc94e376ea2a76a561ed8b1836ee04fd1cd23ad88c \
|
||||||
--hash=sha256:67f615650843a6663d1dc127f6367f0cc08ef515ea4fe96bbd8a00772743a8ca
|
--hash=sha256:d431187fa703c9f52225080ae56471272679e44d9363f97b7b3187d37a5e6480
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
__version__ = "0.1.30"
|
__version__ = "0.1.32"
|
||||||
|
|||||||
@@ -32,12 +32,15 @@ from xiaomusic.utils import (
|
|||||||
fuzzyfinder,
|
fuzzyfinder,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from xiaomusic import (
|
||||||
|
__version__,
|
||||||
|
)
|
||||||
|
|
||||||
EOF = object()
|
EOF = object()
|
||||||
|
|
||||||
PLAY_TYPE_ONE = 0 # 单曲循环
|
PLAY_TYPE_ONE = 0 # 单曲循环
|
||||||
PLAY_TYPE_ALL = 1 # 全部循环
|
PLAY_TYPE_ALL = 1 # 全部循环
|
||||||
|
|
||||||
|
|
||||||
class XiaoMusic:
|
class XiaoMusic:
|
||||||
def __init__(self, config: Config):
|
def __init__(self, config: Config):
|
||||||
self.config = config
|
self.config = config
|
||||||
@@ -76,9 +79,13 @@ class XiaoMusic:
|
|||||||
self._stop_timer = None
|
self._stop_timer = None
|
||||||
|
|
||||||
# setup logger
|
# setup logger
|
||||||
|
logging.basicConfig(
|
||||||
|
format=f"[{__version__}]\t%(message)s",
|
||||||
|
datefmt="[%X]",
|
||||||
|
handlers=[RichHandler(rich_tracebacks=True)]
|
||||||
|
)
|
||||||
self.log = logging.getLogger("xiaomusic")
|
self.log = logging.getLogger("xiaomusic")
|
||||||
self.log.setLevel(logging.DEBUG if config.verbose else logging.INFO)
|
self.log.setLevel(logging.DEBUG if config.verbose else logging.INFO)
|
||||||
self.log.addHandler(RichHandler())
|
|
||||||
self.log.debug(config)
|
self.log.debug(config)
|
||||||
|
|
||||||
# 启动时重新生成一次播放列表
|
# 启动时重新生成一次播放列表
|
||||||
@@ -267,14 +274,7 @@ class XiaoMusic:
|
|||||||
)
|
)
|
||||||
|
|
||||||
async def force_stop_xiaoai(self):
|
async def force_stop_xiaoai(self):
|
||||||
# TODO:
|
await self.mina_service.player_stop(self.device_id)
|
||||||
#await self.mina_service.player_stop(self.device_id)
|
|
||||||
await self.mina_service.ubus_request(
|
|
||||||
self.device_id,
|
|
||||||
"player_play_operation",
|
|
||||||
"mediaplayer",
|
|
||||||
{"action": "stop", "media": "app_ios"},
|
|
||||||
)
|
|
||||||
|
|
||||||
# 是否在下载中
|
# 是否在下载中
|
||||||
def is_downloading(self):
|
def is_downloading(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user