How I built a CLI music player in Python and what I learned
Описание и применение
CLI‑музыкальный проигрыватель на Python, использующий Deezer API, yt-dlp и VLC, с локальной базой SQLite. Решена проблема блокировки БД, получена практическая работа с API и потоковым воспроизведением.
Задача
Build a daily-use command line music player that integrates with Deezer, streams audio, and manages playlists locally.
Результат
A functional CLI music player with integrated search, streaming, playback, and local data storage, plus lessons on database locking and environment debugging.
Рабочий процесс
- 1. Use Deezer API to search artists and songs.
- 2. Fetch and stream audio with yt-dlp.
- 3. Control playback using VLC.
- 4. Store playlists and favorite artists in a local SQLite database.
- 5. Handle API calls with requests.
- 6. Resolve database locking by ensuring all connections are closed and committing after both inserts.
Доказательства
When I added the feature to save artists and songs simultaneously, I kept getting a "database locked" error.
Killed the processes, added proper connection closing on exit, fixed immediately.
- Дата записи: 2026-09-18T05:15:32.291Z