Skip to main content

No project description provided

Project description

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.

I created it to be able to edit paths to audio files in the playlist, although it's possible to change any tracks properties.

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:

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)

Then use it:

python3 ./script.py --input old.dbpl --output new.dbpl

License

BSD-2c

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbpl-1.0.1.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

dbpl-1.0.1-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page