Metalinks plugin

Hello,

I have a draft of a plugin called beets-metalinks. My goal is to help HTTP downloads of my library (on every platform). The idea is to work with softwares like aria2.

The plugin manages metalinks in the beets library. Briefly, metalink is a xml files that gather download links.
For example, an album in my library will have the following tree:
/myArtist/myAlbum

  • download.metalink
  • song 1
  • song 2
  • song 3

And the metalink will look like:

<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<metalink xmlns="urn:ietf:params:xml:ns:metalink">
  <file name="myArtist-myAlbum/song1">
    <url>song1</url>
    <hash>123456</hash>
  </file>
  <file name="myArtist-myAlbum/song2">
    <url>song2</url>
    <hash>789abc</hash>
  </file>
  <file name="myArtist-myAlbum/song3">
    <url>song3</url>
    <hash>defghi</hash>
  </file>
</metalink>

Downloading this metalink should result in a directory name myArtist-myAlbum containing the three songs.

A this stage, the plugin handle copy, move and remove events (and process them at exit). It is mainly inspired from beets-extrafiles.
Next step is to add commands that will create a metalink for existing files in the library.

I am not an expert neither in python, neither in web things. Therefore, comments are welcomed. The repo is Louis / beets-metalinks · GitLab

1 Like