# Metalinks plugin

**URL:** <https://discourse.beets.io/t/metalinks-plugin/1747>\
**Category:** Development\
**Created:** [April 15, 2021, 11:27pm UTC](https://discourse.beets.io/t/metalinks-plugin/1747 "2021-04-15T23:27:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![louson](https://avatars.discourse-cdn.com/v4/letter/l/b5e925/32.png) [@louson](https://discourse.beets.io/u/louson)\
**Post date:** [April 15, 2021, 11:27pm UTC](https://discourse.beets.io/t/metalinks-plugin/1747/1 "2021-04-15T23:27:31Z")

</div>

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](https://aria2.github.io/).

The plugin manages [metalinks](https://tools.ietf.org/html/rfc5854) 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
<?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](https://gitlab.com/Louson/beets-metalinks)
