# Submit your "listens" with foobar2000

**URL:** https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704
**Category:** ListenBrainz
**Tags:** foobar2000
**Created:** [August 19, 2017, 1:59am UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704 "2017-08-19T01:59:12Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Deleted\_Editor\_1409249](https://community.metabrainz.org/user_avatar/community.metabrainz.org/deleted_editor_1409249/32/34467_2.png) [@Deleted\_Editor\_1409249](https://community.metabrainz.org/u/Deleted_Editor_1409249)
#### Post date: [August 19, 2017, 1:59am UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/1 "2017-08-19T01:59:13Z")

</div>

This isn’t a dedicated component but rather a script and you’ll need to follow this guide to install the component it requires first.

`https://github.com/19379/foo-jscript-panel/wiki/Requirements-&-Installation`

In the section about **samples** , there is one included in the **complete** folder named **listenbrainz.txt** so just paste the code from that in to a panel, read the note about adding your [listenbrainz token](https://listenbrainz.org/user/info) and you’re good to go. There are a couple of other options to look at when clicking the button as well.

It obeys the same rules as [last.fm](http://last.fm) so you have to listen to at least half the track - or 4 minutes - whichever comes sooner. All activity can be viewed via the foobar2000 Console (found on the view menu).

If present, the script submits various musicbrainz IDs contained within your files as documented towards the bottom of this page.

[https://listenbrainz.readthedocs.io/en/production/dev/json.html#submission-json](https://listenbrainz.readthedocs.io/en/production/dev/json.html#submission-json)

Note that foobar itself does not support id3v2/UFID tags so it can’t submit those. As an alternative, you may tag your files with a recording ID in the **musicbrainz track id** or **musicbrainz\_trackid** TXXX frames. Scroll down to post 20 for a quick Picard script that can copy values. I can’t post a direct link as the forum does this stupid preview box which I despise!!

**Please make sure you have the latest version**. You can check under File\>Preferences\>Components\>JScript Panel or use Help\>Check for updated components.

Changes:  
`v1.2.3.1` First version with listenbrainz script included

`v1.2.3.2` Fix for **musicbrainz track id** not being submitted from m4a files. It’s also now supported as a TXXX frame for files tagged with id3v2 tags.

`v1.2.3.3` Caching/retry support has been added but I’m very much a noob so report any issues if you encounter them! Also please report any code 400 errors you see in the Console as the script will need updating before these tracks can be submitted successfully.

`v1.2.4` You can now toggle the script on/off via the button menu. (The bigger version bump is for other component/script changes, not just this!!)

Full changelog/download

[https://github.com/19379/foo-jscript-panel/releases](https://github.com/19379/foo-jscript-panel/releases)

---

<div class="post-metadata">

### Author: ![WovenTales](https://community.metabrainz.org/user_avatar/community.metabrainz.org/woventales/32/5963_2.png) [@WovenTales](https://community.metabrainz.org/u/WovenTales)
#### Post date: [August 19, 2017, 2:20am UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/2 "2017-08-19T02:20:46Z")

</div>

Yay, thanks! I’ve been waiting for something like this. I assume there’s enough support in MessyBrainz to compensate for not being able to submit recording IDs with MP3s?

---

<div class="post-metadata">

### Author: ![Deleted\_Editor\_1409249](https://community.metabrainz.org/user_avatar/community.metabrainz.org/deleted_editor_1409249/32/34467_2.png) [@Deleted\_Editor\_1409249](https://community.metabrainz.org/u/Deleted_Editor_1409249)
#### Post date: [August 19, 2017, 2:35am UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/3 "2017-08-19T02:35:50Z")

</div>

I have no idea how messybrainz works but the IDs are available in the exported data so it should be something you can test. FWIW, foobar does support **musicbrainz\_trackid** if written as TXXX.

---

<div class="post-metadata">

### Author: ![mfmeulenbelt](https://community.metabrainz.org/user_avatar/community.metabrainz.org/mfmeulenbelt/32/449_2.png) [@mfmeulenbelt](https://community.metabrainz.org/u/mfmeulenbelt)
#### Post date: [August 19, 2017, 5:13am UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/4 "2017-08-19T05:13:01Z")

</div>

Does the requirement of the jscript panel mean that I need to have a panel in my UI somewhere just to use the script? Or can it run somewhere in the background?

---

<div class="post-metadata">

### Author: ![Deleted\_Editor\_1409249](https://community.metabrainz.org/user_avatar/community.metabrainz.org/deleted_editor_1409249/32/34467_2.png) [@Deleted\_Editor\_1409249](https://community.metabrainz.org/u/Deleted_Editor_1409249)
#### Post date: [August 19, 2017, 6:02am UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/5 "2017-08-19T06:02:57Z")

</div>

Columns UI users can hide it by using the **Hidden** checkbox on the **Layout** tab in the preferences.

Default UI users can minimise the size so it’s barely visible. First right click\>Background\>Splitter. Then right click\>Configure and comment out this line of code on line 30

`//buttons.paint(gr);`

Now drag the splitter down and minimise as far as you can go and with **Layout editing mode** enabled, you can lock it in size like this…

 ![](http://i.imgur.com/9WzkGs8.gif)  
Click the image to view full size

---

<div class="post-metadata">

### Author: ![mfmeulenbelt](https://community.metabrainz.org/user_avatar/community.metabrainz.org/mfmeulenbelt/32/449_2.png) [@mfmeulenbelt](https://community.metabrainz.org/u/mfmeulenbelt)
#### Post date: [August 19, 2017, 6:12am UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/6 "2017-08-19T06:12:16Z")

</div>

Cool. I’m using ColumnsUI but I didn’t know I could hide panels.

---

<div class="post-metadata">

### Author: ![WovenTales](https://community.metabrainz.org/user_avatar/community.metabrainz.org/woventales/32/5963_2.png) [@WovenTales](https://community.metabrainz.org/u/WovenTales)
#### Post date: [August 19, 2017, 7:01am UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/7 "2017-08-19T07:01:01Z")

</div>

To give an update on the recording ID question, compare the first two listens on [my profile](https://listenbrainz.org/user/WovenTales). The first was a FLAC, the second an MP3, and both files have the full complement of ID fields. It doesn’t look like MessyBrainz was able to get the recording ID from the track, or anything. A bit unfortunate, but sounds like the only possible fix would be making MeB smarter or linking LB to it more closely, and I have no idea what the code of either looks like to say which is needed. Really enjoying the script so far, though! Now I just need to see what it would take to link to the MusicBrainz rating system…

---

<div class="post-metadata">

### Author: ![mfmeulenbelt](https://community.metabrainz.org/user_avatar/community.metabrainz.org/mfmeulenbelt/32/449_2.png) [@mfmeulenbelt](https://community.metabrainz.org/u/mfmeulenbelt)
#### Post date: [August 19, 2017, 7:11am UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/8 "2017-08-19T07:11:59Z")

</div>

Maybe someone can make a script for Picard to write recording IDs to TXXX frames if id3 is used, and the ListenBrainz script can be updated to look for the TXXX frame if the UFID tag isn’t found?

It might also be possible to convince the foobar devs to support the UFID tag of course.

---

<div class="post-metadata">

### Author: ![Deleted\_Editor\_1409249](https://community.metabrainz.org/user_avatar/community.metabrainz.org/deleted_editor_1409249/32/34467_2.png) [@Deleted\_Editor\_1409249](https://community.metabrainz.org/u/Deleted_Editor_1409249)
#### Post date: [August 19, 2017, 8:10am UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/9 "2017-08-19T08:10:34Z")

</div>

Well I don’t understand Picard at all. There’s simply no reason for the UFID tag to ever have been used. It’s a plain text name and value just like all other TXXX frames. Like I mentioned above, if you use TXXX:musicbrainz\_trackid, the script will submit them. The album I’m listening to right now is mp3 and you can see the track listing on the webpage has a clickable link because a recording ID was submitted…

 ![](http://i.imgur.com/ymZLZWN.png)

---

<div class="post-metadata">

### Author: ![mfmeulenbelt](https://community.metabrainz.org/user_avatar/community.metabrainz.org/mfmeulenbelt/32/449_2.png) [@mfmeulenbelt](https://community.metabrainz.org/u/mfmeulenbelt)
#### Post date: [August 19, 2017, 9:18am UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/10 "2017-08-19T09:18:33Z")

</div>

Well, according to the [id3v2.4 spec](http://id3.org/id3v2.4.0-frames), the purpose of the UFID tag is to: “be able to identify the audio file in a database, that may provide more information relevant to the content.” So I think it made sense initially. But nowadays MusicBrainz has a lot of similar identifiers, which are stored in a TXXX frame, so it would be more consistent to use TXXX for all of them.

Pinging @Sophist and @samj1912

---

<div class="post-metadata">

### Author: ![Sophist](https://community.metabrainz.org/user_avatar/community.metabrainz.org/sophist/32/70055_2.png) [@Sophist](https://community.metabrainz.org/u/Sophist)
#### Post date: [August 19, 2017, 9:55am UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/11 "2017-08-19T09:55:41Z")

</div>

> [@mfmeulenbelt](#):
>
> Well, according to the id3v2.4 spec, the purpose of the UFID tag is to: “be able to identify the audio file in a database, that may provide more information relevant to the content.” So I think it made sense initially. But nowadays MusicBrainz has a lot of similar identifiers, which are stored in a TXXX frame, so it would be more consistent to use TXXX for all of them.

UFID is also in id3v2.3.

I don’t actually like the UFID definition - where the Owner Identifier field is supposed to be used for an email address or a web page containing an email address that people can used to email questions about the database. (Any volunteers for handling the millions of emails that this might generate?? 😉 )

However, if we ignore that and use the Owner Identifier field for either the MuB home page or a file-specific URL, then there is no reason why Picard shouldn’t read/write/populate the UFID tag.

I would put the Owner Identifier as either the MuB home page or the URL to the Release / Recording web page, and the identifier as the Track / Recording MBID (not sure which of these options would be best).

The other question is whether we should overwrite an existing UFID tag if it holds information for a database other than MB (given that we already have the TXXX fields as the primary indexes into our database) - my gut reaction would be to add support in Picard for reading/writing UFID, and use one of two plugins to populate it - one plugin to populate it regardless of existing contents, the other to populate it only if it doesn’t have a different database already.

---

<div class="post-metadata">

### Author: ![mfmeulenbelt](https://community.metabrainz.org/user_avatar/community.metabrainz.org/mfmeulenbelt/32/449_2.png) [@mfmeulenbelt](https://community.metabrainz.org/u/mfmeulenbelt)
#### Post date: [August 19, 2017, 11:25am UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/12 "2017-08-19T11:25:26Z")

</div>

But right now Picard doesn’t seem to write the MusicBrainz Recording ID tag to a TXXX field, because that tag isn’t visible in foobar2000 (so it is probably written to the UFID field). Picard also seems to write the MusicBrainz Track ID to a tag called “MUSICBRAINZ RELEASE TRACK ID” which the ListenBrainz script doesn’t seem to pick up.

MBIDs in foobar2000:

 ![tags in foobar](https://community.metabrainz.org/uploads/default/original/2X/0/0857a4c4c01ab4838f15e5d4cfc7756a02ffba24.png)

MBIDs in Picard:

 ![tags in picard](https://community.metabrainz.org/uploads/default/original/2X/b/bef83b7cbcbe8b9d324acf9bf1cc4f2c0c9353bd.png)

---

<div class="post-metadata">

### Author: ![Deleted\_Editor\_1409249](https://community.metabrainz.org/user_avatar/community.metabrainz.org/deleted_editor_1409249/32/34467_2.png) [@Deleted\_Editor\_1409249](https://community.metabrainz.org/u/Deleted_Editor_1409249)
#### Post date: [August 19, 2017, 2:11pm UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/13 "2017-08-19T14:11:37Z")

</div>

**musicbrainz release track id** can’t be used as it’s the not the recording. If I use mp3tag on an mp3 album tagged with Picard, it shows **musicbrainz\_trackid (UFID)** and **musicbrainz release track id** which have different values.

![](http://i.imgur.com/Qr3dtrU.png)

Using the **musicbrainz release track id** on the recording URL simply doesn’t exist…

[https://musicbrainz.org/recording/43b3f2ca-5fa7-46ca-9fd6-7d2df3d12fab](https://musicbrainz.org/recording/43b3f2ca-5fa7-46ca-9fd6-7d2df3d12fab)

whereas **musicbrainz\_trackid** does…

[https://musicbrainz.org/recording/08dc6182-c3f7-4131-be17-2fcaf5d7398f](https://musicbrainz.org/recording/08dc6182-c3f7-4131-be17-2fcaf5d7398f)

edit: clearly Picard should be showing both of those as separate entities but it’s not my responsibility to explain any of this nonsense!!

---

<div class="post-metadata">

### Author: ![stupidname](https://community.metabrainz.org/user_avatar/community.metabrainz.org/stupidname/32/98_2.png) [@stupidname](https://community.metabrainz.org/u/stupidname)
#### Post date: [August 19, 2017, 2:29pm UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/14 "2017-08-19T14:29:47Z")

</div>

> [@marc2k3](#):
>
> Using the musicbrainz release track id on the recording URL simply doesn’t exist…
> 
> [https://musicbrainz.org/recording/43b3f2ca-5fa7-46ca-9fd6-7d2df3d12fab](https://musicbrainz.org/recording/43b3f2ca-5fa7-46ca-9fd6-7d2df3d12fab)

That’s because “MusicBrainz Release Track Id” is a **track** ID, not a recording ID.

> **[Citizen of Glass](https://musicbrainz.org/release/0d98ccb8-3e6c-442f-bdff-9f3187fa71f5/disc/1#43b3f2ca-5fa7-46ca-9fd6-7d2df3d12fab)**
>
> Official release by Agnes Obel, 2016-10-21
>   
> 10 total tracks (Digital Media)

You should submit it as “track\_mbid” to ListenBrainz.

---

<div class="post-metadata">

### Author: ![Deleted\_Editor\_1409249](https://community.metabrainz.org/user_avatar/community.metabrainz.org/deleted_editor_1409249/32/34467_2.png) [@Deleted\_Editor\_1409249](https://community.metabrainz.org/u/Deleted_Editor_1409249)
#### Post date: [August 19, 2017, 2:37pm UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/15 "2017-08-19T14:37:33Z")

</div>

I already do that.

I hadn’t noticed because none of my tracks contain it. I use foo\_musicbrainz for tagging which doesn’t write it.

edit: if people enable this option (it’s off by default)

![](http://i.imgur.com/yNCxjZS.png)

…they can see the full JSON payload in the Console when it’s sent.

---

<div class="post-metadata">

### Author: ![Freso](https://community.metabrainz.org/user_avatar/community.metabrainz.org/freso/32/25_2.png) [@Freso](https://community.metabrainz.org/u/Freso)
#### Post date: [August 20, 2017, 7:37pm UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/16 "2017-08-20T19:37:39Z")

</div>

> [@WovenTales](#):
>
> I assume there’s enough support in MessyBrainz to compensate for not being able to submit recording IDs with MP3s?

Track MBIDs are more specific than Recording ones and _should_ be submitted as they’re `TXXX:MusicBrainz Release Track Id` fields. (A Track MBID is a Recording in a specific position on a specific Release, so one Track will always equal exactly one Recording, though one Recording can equal multiple Tracks.)

So MessyBrainz _should_ be able to figure it out if it has a full set of the other MBIDs. Of course, if won’t help much for standalone recordings that do not have a Track MBID, due to not existing on any Releases.

---

<div class="post-metadata">

### Author: ![Freso](https://community.metabrainz.org/user_avatar/community.metabrainz.org/freso/32/25_2.png) [@Freso](https://community.metabrainz.org/u/Freso)
#### Post date: [August 20, 2017, 7:40pm UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/17 "2017-08-20T19:40:55Z")

</div>

> [@Sophist](#):
>
> I don’t actually like the UFID definition - where the Owner Identifier field is supposed to be used for an email address or a web page containing an email address that people can used to email questions about the database. (Any volunteers for handling the millions of emails that this might generate?? 😉 )

I really, really doubt that it would generate millions of e-mails, and besides, we already have a manned e-mail/contact address for just this purpose:  
[https://metabrainz.org/contact](https://metabrainz.org/contact)

> [@Sophist](#):
>
> However, if we ignore that and use the Owner Identifier field for either the MuB home page or a file-specific URL, then there is no reason why Picard shouldn’t read/write/populate the UFID tag.

According to [the tag mapping](https://picard.musicbrainz.org/docs/mappings/), Picard should currently use `UFID:http://musicbrainz.org` for Recording MBIDs. If it doesn’t set this field already, that’s probably a bug.

However, using that field doesn’t mean we can’t also use `TXXX:MusicBrainz Recording Id`.

---

<div class="post-metadata">

### Author: ![WovenTales](https://community.metabrainz.org/user_avatar/community.metabrainz.org/woventales/32/5963_2.png) [@WovenTales](https://community.metabrainz.org/u/WovenTales)
#### Post date: [August 20, 2017, 7:59pm UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/18 "2017-08-20T19:59:02Z")

</div>

Yeah, from everything I’ve seen digging into the files, we do properly set `UFID:http://musicbrainz.org`. I did a quick search, and it seems like foobar2000 doesn’t have any intention of supporting it, though, because it isn’t a plain text tag. A bit shortsighted in my opinion, but as you said, the track IDs would be more accurate.

My complaint was that ListenBrainz only seems to add a link on the song title if it’s given a recording ID, rather than being able to guess it from the track. It does make some sense – the recording linked to a track may change – but it seems like LB or MeB might give up too quickly.

---

<div class="post-metadata">

### Author: ![Deleted\_Editor\_1409249](https://community.metabrainz.org/user_avatar/community.metabrainz.org/deleted_editor_1409249/32/34467_2.png) [@Deleted\_Editor\_1409249](https://community.metabrainz.org/u/Deleted_Editor_1409249)
#### Post date: [August 20, 2017, 9:54pm UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/19 "2017-08-20T21:54:42Z")

</div>

Right, I’ve discovered my first bug, If you have properly tagged m4a files, my script won’t submit **musicbrainz track id** tags as specified on the tag mapping page.

I actually think this would be the best bet as an “alternate” for id3v2 as well as it matches the existing naming convention of all the other MBID specific TXXX frames as well. However, if you guys want to list others, I may add them.

edit: An updated version with a fix for the m4a problem has been uploaded. I’ve also updated the first post mentioning that **musicbrainz\_trackid** or **musicbrainz track id** written as TXXX may be used for files containing id3v2 tags. This is because foobar does not support and isn’t likely to support UFID tags.

---

<div class="post-metadata">

### Author: ![Deleted\_Editor\_1409249](https://community.metabrainz.org/user_avatar/community.metabrainz.org/deleted_editor_1409249/32/34467_2.png) [@Deleted\_Editor\_1409249](https://community.metabrainz.org/u/Deleted_Editor_1409249)
#### Post date: [August 22, 2017, 5:39am UTC](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704/20 "2017-08-22T05:39:43Z")

</div>

> [@mfmeulenbelt](#):
>
> Maybe someone can make a script for Picard to write recording IDs to TXXX frames if id3 is used, and the ListenBrainz script can be updated to look for the TXXX frame if the UFID tag isn’t found?

Here you go.

`$copy(_id3:TXXX:MUSICBRAINZ TRACK ID,musicbrainz_recordingid)`

I only tested on one album so you might want to test it on copies a bit more thoroughly.

If you open the file with mp3tag, you should see the new **MUSICBRAINZ TRACK ID** match the **MUSICBRAINZ\_TRACKID** (which is the UFID frame) like this…

![](http://i.imgur.com/ZUwd9gR.png)

and obviously foobar2000 can now see it…

![](http://i.imgur.com/ms0XcvS.png)

Latest version of the script is required for this, check the first post for details.

[Next page](https://community.metabrainz.org/t/submit-your-listens-with-foobar2000/324704.md?page=2)
