Skip to content

Commit

Permalink
支持配置 ffmpeg 路径 #15
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxi committed Feb 24, 2024
1 parent 17d7f54 commit 54b4417
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions xiaomusic/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class Config:
search_prefix: str = os.getenv(
"XIAOMUSIC_SEARCH", "ytsearch:"
) # "bilisearch:" or "ytsearch:"
ffmpeg_location: str = os.getenv("XIAOMUSIC_FFMPEG_LOCATION", "./ffmpeg/bin")

def __post_init__(self) -> None:
if self.proxy:
Expand Down
3 changes: 2 additions & 1 deletion xiaomusic/xiaomusic.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def __init__(self, config: Config):
self.port = config.port
self.proxy = config.proxy
self.search_prefix = config.search_prefix
self.ffmpeg_location = config.ffmpeg_location

# 下载对象
self.download_proc = None
Expand Down Expand Up @@ -311,7 +312,7 @@ async def download(self, name):
"-o",
f"{name}.mp3",
"--ffmpeg-location",
"./ffmpeg/bin",
f"{self.ffmpeg_location}",
"--no-playlist",
)

Expand Down

0 comments on commit 54b4417

Please sign in to comment.