cpls is a minimalist Python-based CLI tool for copying music files from playlists to the specified folder, usually a USB drive or an external device.
It intelligently handles path resolution, file format mapping, and automatic transcoding.
python cpls.py music.m3u /media/usb-drive/To see all available options:
python cpls.py --help- Playlist Support: Tool for parsing
.m3u,.m3u8, and simple.txtfiles (one file path per line). - Metadata Awareness: Automatically skips lines starting with
#(e.g.,#EXTINFmetadata) and empty lines. - Context-Aware Paths: Full support for relative paths, resolved against the playlist file's location.
- Device Profiles: Use profile files in the
profiles/directory to define hardware compatibility. - Extension Mapping: Tool for renaming extensions based on profile rules (e.g.,
ogg opusmaps.opusfiles to.ogg). - Auto-Transcoding: Automatically converts any unsupported formats to MP3 via ffmpeg.
- Python 3.x
- ffmpeg (must be available in your system PATH for transcoding)
Profiles are stored as text files in the profiles/ directory. The program parses them line by line:
- Single extension per line: The format is considered supported (e.g.,
flac). - Multiple extensions per line: If a line contains multiple extensions (e.g.,
ogg opus), files using any of the subsequent extensions are considered supported and will be renamed to the first one in that line. - Automatic Conversion: Any file extension not listed in the active device profile is automatically transcoded to MP3 using
ffmpeg. - Comments: Lines beginning with a
#are ignored. We recommend starting the profile file with a comment listing the names of supported devices, followed by comments indicating the sources of information, such as links to device manuals or manufacturers' websites.
This project is licensed under the GNU General Public License v3.0 (GPLv3). See the LICENSE file for the full text.