summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-04-21 01:51:29 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-04-21 01:51:29 +0300
commit2ce9e0fdf1617b7287fe81a3c5eb55c15c0a79b8 (patch)
tree9d5ec28197a9ed087d8a4322ae373aafa2e7f3cc /README.md
parent9df6761f5f464c4428cd227996169ccb8317f3de (diff)
add readme
Diffstat (limited to 'README.md')
-rw-r--r--README.md41
1 files changed, 41 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..d1a5c54
--- /dev/null
+++ b/README.md
@@ -0,0 +1,41 @@
+# 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.
+
+## 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)
+```
+
+Then use it:
+```
+python3 ./script.py --input old.dbpl --output new.dbpl
+```
+
+## License
+
+BSD-2c \ No newline at end of file