Example: build a read-only live lyrics companion

未关闭
#86 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
api

调研方向

Create the new script at examples/live_lyrics.py, using examples/player.py and examples/lyrics.py as the reference for resource ownership and cancellation. Read how PlaybackState.position_ms and Lyrics.at() are exposed in the typed player and lyrics APIs before selecting the active line. Done means the script runs offline checks, handles missing or unsynchronized lyrics, discards stale lyric fetches on track change, exits cleanly on Ctrl+C, and is linked from the player docs.

由索引模型根据 Issue 内容生成。

描述

documentation enhancement help wanted

Goal

Add one polished example that combines SpotAPI's existing typed player and lyrics APIs into a live, synchronized terminal companion. This demonstrates a complete workflow without expanding the core library.

Expected workflow

The example should:

  1. connect using the user's SPOTIFY_COOKIE;
  2. observe an existing Spotify player without starting playback;
  3. fetch lyrics when the current track changes;
  4. select active lines using PlaybackState.position_ms and Lyrics.at();
  5. print track information, the current lyric, and the supplied artwork URL when available.

Acceptance criteria

  • Add a focused examples/live_lyrics.py script with no new runtime dependency.
  • Do not send playback commands, download audio, or write account data.
  • Handle tracks without lyrics and unsynchronized lyrics clearly.
  • Cancel or discard stale lyric work when the track changes.
  • Exit cleanly on Ctrl+C and close owned resources.
  • Link the example from the player documentation.
  • Keep credentials out of output and error messages.
  • Run the existing offline quality checks; a maintainer will perform final live verification.

Notes

This uses authenticated, entitlement-dependent Spotify behavior and therefore requires more care than the two beginner CLI issues. Preserve the ownership and cancellation patterns used in examples/player.py and examples/lyrics.py.

Comment before starting so duplicate work can be avoided.

主要语言
Python
星标
493
派生
40
平均合并
5 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Aran404/SpotAPI 的其他 Issue

查看 Aran404/SpotAPI 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。