Skip to content

Commit

Permalink
feat: better notice when download complete
Browse files Browse the repository at this point in the history
Signed-off-by: jingfelix <jingfelix@outlook.com>
  • Loading branch information
jingfelix committed Nov 11, 2024
1 parent 3612694 commit 091975b
Showing 1 changed file with 40 additions and 4 deletions.
44 changes: 40 additions & 4 deletions src/bilifm/command.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os

import typer
from rich.console import Console
from rich.panel import Panel

from .__version__ import __version__
from .audio import Audio
Expand All @@ -12,6 +14,8 @@

app = typer.Typer()

console = Console()


@app.callback(invoke_without_command=True)
def callback(version: bool = False):
Expand Down Expand Up @@ -47,7 +51,15 @@ def uid(
audio = Audio(bv, audio_quality)
audio.download()

typer.echo("Download complete")
console.print(
Panel(
f"已下载 UID {uid} 的所有音频",
subtitle="下载完成",
title="UID 下载",
style="bold green",
expand=False,
)
)


@app.command()
Expand All @@ -66,7 +78,15 @@ def fav(
audio = Audio(bvid, audio_quality)
audio.download()

typer.echo("Download complete")
console.print(
Panel(
f"已下载 收藏夹 {media_id} 的所有音频",
subtitle="下载完成",
title="收藏夹下载",
style="bold green",
expand=False,
)
)


@app.command()
Expand All @@ -89,7 +109,15 @@ def season(
for id in audios:
audio = Audio(id, audio_quality)
audio.download()
typer.echo("Download complete")
console.print(
Panel(
f"已下载 合集 {sid} 的所有音频",
subtitle="下载完成",
title="合集下载",
style="bold green",
expand=False,
)
)


@app.command()
Expand All @@ -113,4 +141,12 @@ def series(
for id in audios:
audio = Audio(id, audio_quality)
audio.download()
typer.echo("Download complete")
console.print(
Panel(
f"已下载 列表 {sid} 的所有音频",
subtitle="下载完成",
title="列表下载",
style="bold green",
expand=False,
)
)

0 comments on commit 091975b

Please sign in to comment.