Skip to content

vtwarrior25/beets-yapl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

beets-yapl

beets plugin to parse a yaml playlist format and compile it into the near universally supported M3U format.

M3U playlists are inherently fragile, breaking at the slightest change in a file's path. This plugin utilises beetDreamers' queries to define playlists in a simple yaml format, where you can provide precisely the level of detail required to unambiguously find the song you're after.

A playlist can be written as:

name: Christmas
tracks:
  # The library only contains one version of this song, so this is enough.
  - title: Christmas (Baby Please Come Home)
    artist: Darlene Love
  # The library contains multiple recordings of this track, so let's include
  # the year to get the right version.
  - artist: Withered Hand
    title: Real Snow
    year: 2013
  # Typing Japanese characters is finicky, so let's just use the track's
  # MusicBrainz ID
  - mb_trackid: dafff56a-f327-4de5-ab35-633c8863857f

which will be compiled into an M3U playlist looking something like:

#EXTM3U
#PLAYLIST:Christmas
#EXTINF:166, Darlene Love - Christmas (Baby Please Come Home)
../Darlene Love/Non-Album/Christmas (Baby Please Come Home).flac
#EXTINF:202, Withered Hand - Real Snow
../Withered Hand/Non-Album/Real Snow.flac
#EXTINF:266, クレイジーケンバンド - クリスマスなんて、大嫌い!!なんちゃって
../クレイジーケンバンド/Non-Album/クリスマスなんて、大嫌い!!なんちゃって.m4a

Getting Started

Installation

To install via pip: Run pip install beets-yapl.

If you're on an Arch-based distro, you can install it from the AUR as beets-yapl-git.

Configuration

Enable the plugin by adding it to your plugin option in the beets configuration and configure the plugin.

plugins:
- ...
- yapl

yapl:
  yapl_path: ~/Music/playlists/
  csv_path: ~/Music/playlists/
  m3u_path: ~/Music/playlists/
  relative: true
  • yapl_path: path: Decides what directory yapl will search for yapl files and where created yapl files will be placed. Can be the same as m3u_path and csv_path.
  • csv_path: path: Decides what directory yapl will search for csv files. Can be the same as m3u_path and csv_path.
  • m3u_path: path: Decides where to output the compiled m3u files or grab input m3u files. Can be the same as yapl_path and csv_path.
  • relative: bool: Controls whether to use absolute or relative filepaths in the outputted M3U files.

Run

Once configured, run beet yapl to compile all the playlists in your yapl_path directory. Warnings will be issued for any ambiguous or resultless queries and these tracks will be left out of the output.

You can also run beet m3ub or beet m3ut to compile yapl files from the m3u8 playlist files within your m3u_path directory. beet m3ub will use the beets database to grab metadata about your songs, and beet m3ut will use the file metadata on the songs. Warnings will be issued for any paths within the m3u8 file that aren't reachable, and after each file is processed a failure count will be outputted.

To take data from csv files and turn it into corresponding yapl files, run beet csv. The input csv files will be grabbed from your csv_path directory and the output yapl files will be placed in your yapl_path directory

$ beet yapl
Parsing christmas.yaml
Multiple results for query: ['artist:Withered Hand', 'title:Real Snow']
No results for query: ['artist:UNPOC', 'title:Icelandic Leopard Cat']
Writing christmas.m3u

About

Beets plugin to manage yaml playlists

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%