https://github.com/gch1p/deadbeef-playlist
python library for reading and writing deadbeef binary playlists in dbpl format
https://github.com/gch1p/deadbeef-playlist
deadbeef
Last synced: 8 months ago
JSON representation
python library for reading and writing deadbeef binary playlists in dbpl format
- Host: GitHub
- URL: https://github.com/gch1p/deadbeef-playlist
- Owner: gch1p
- License: bsd-2-clause
- Created: 2021-04-20T19:21:34.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-04T20:41:12.000Z (about 5 years ago)
- Last Synced: 2025-02-24T21:03:56.662Z (over 1 year ago)
- Topics: deadbeef
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deadbeef-playlist
This is a Python library for reading and writing playlists in the "DBPL" binary
format, created by my absolute favorite desktop audio player
[DeaDBeeF](https://github.com/DeaDBeeF-Player/deadbeef).
I created it to be able to edit paths to audio files in the playlist, although
it's possible to change any tracks properties.
## Installation
It's available in Pypi:
```
pip install dbpl
```
## Example
Let's imagine you have a large `.dbpl` playlist with hundreds of items, and you want
to change tracks paths from `/data/music` to `/Volumes/music`. Write a script
named `script.py`:
```python
from dbpl import Playlist
from argparse import ArgumentParser
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument('--input', required=True, help='input file')
parser.add_argument('--output', required=True, help='output file')
args = parser.parse_args()
playlist = Playlist(args.input)
for t in playlist.tracks:
uri = t.get_uri()
uri = uri.replace('/data/music', '/Volumes/music')
t.set_uri(uri)
playlist.save(args.output)
```
## License
BSD-2c