Example: build a read-only live lyrics companion

Aperta
#86 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
493
Fork
40
Merge medio
5m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Aran404/SpotAPI

Tutte le issue di Aran404/SpotAPI

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.