Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I needed this exact thing, and I, too, realized quickly that mutagen is not a distant enough abstraction to do this kind of thing. Fortunately, the authors of mutagen needed it for their media player <a href="http://code.google.com/p/quodlibet/" rel="noreferrer">QuodLibet</a>.</p> <p>I had to dig through the QuodLibet source to find out how to use it, but once I understood it, I wrote a utility called <strong>sequitur</strong> which is intended to be a command line equivalent to <strong>ExFalso</strong> (QuodLibet's tagging component). It uses this abstraction mechanism and provides some added abstraction and functionality.</p> <p>If you want to check out the source, <a href="http://jeremycantrell.com/files/python-qlcli.tar.gz" rel="noreferrer">here's a link to the latest tarball</a>. The package is actually a set of three command line scripts and a module for interfacing with QL. If you want to install the whole thing, you can use:</p> <pre><code>easy_install QLCLI </code></pre> <p>One thing to keep in mind about exfalso/quodlibet (and consequently sequitur) is that they actually implement audio metadata properly, which means that all tags support multiple values (unless the file type prohibits it, which there aren't many that do). So, doing something like:</p> <pre><code>print qllib.AudioFile('foo.mp3')['artist'] </code></pre> <p>Will not output a single string, but will output a list of strings like:</p> <pre><code>[u'The First Artist', u'The Second Artist'] </code></pre> <p>The way you might use it to copy tags would be something like:</p> <pre><code>import os.path import qllib # this is the module that comes with QLCLI def update_tags(mp3_fn, flac_fn): mp3 = qllib.AudioFile(mp3_fn) flac = qllib.AudioFile(flac_fn) # you can iterate over the tag names # they will be the same for all file types for tag_name in mp3: flac[tag_name] = mp3[tag_name] flac.write() mp3_filenames = ['foo.mp3', 'bar.mp3', 'baz.mp3'] for mp3_fn in mp3_filenames: flac_fn = os.path.splitext(mp3_fn)[0] + '.flac' if os.path.getmtime(mp3_fn) != os.path.getmtime(flac_fn): update_tags(mp3_fn, flac_fn) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload