1 (edited by JonnyJD 2013-04-02 16:36:06)

Topic: ISRC submission for Linux, Windows and Mac OS X (python, console)

This is a followup to: http://forums.musicbrainz.org/viewtopic.php?id=1908
but I can't change the title.

My Python ISRC submission tool now works with Linux, Windows and Mac OS X and has support for the following backends:
mediatools, cd_info, cdrdao, discisrc, cdda2wav, icedax, drutil (Mac OS X)

Additional features: discId submission, duplicate detection (local and server)

Info and Downloads at http://jonnyjd.github.com/musicbrainz-isrcsubmit/

You can submit bugs at github, if you have an account.
There are packages with pre-built libdiscid libraries (and python-musicbrain2) included, because having these on mac is not as straightforward as for linux.
Current Version: 1.0.1
Current pre-release: 2.0.0-beta.1

If you have more than one backend, it will choose one automatically. You also can set it as a command line option and try multiple tools, when you have duplicates or other problems.
There is a duplicate detection on the current disc and it also tries to find duplicates on the server for the ISRCs that were on the disc (known to be correct).

The script will show you corresponding metadata, guide you through the submission process: optionally submitting the DiscID, finding the disc on MB, setting offsets due to problems with the old xml web service.
This version still works with the old web service, but has general multi-disc-support. A complete NGS version is planned. python-musicbrainzngs looks promising and recently added isrc support.

The musicbrainz documentation lists other ISRC tools.

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

Now version 0.4.1

There was a problem with bonus DVDs.
See: https://github.com/JonnyJD/musicbrainz- … /issues/16

3 (edited by sbontrager 2012-08-10 02:12:27)

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

I added ISRC reading capabilities to GNU's libcdio a while back. The cd-info tool which comes with libcdio displays both the q-channel and CD-TEXT ISRC data. I don't know if this would be of any help here. I wouldn't think it would be too much work to write a python wrapper to libcdio and get the ISRC info without needing any helper applications.

http://www.gnu.org/software/libcdio/doxygen/mmc_8h.html

libcdio works on Linux, *BSD, Mac OS X and Windows.

Well, looks like there already is a python wrapper! http://git.savannah.gnu.org/gitweb/?p=l … pycdio.git

4 (edited by JonnyJD 2012-10-16 16:20:30)

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

Updated to version 0.4.2:

- duplicated ISRCS in the CD-TEXT won't confuse the script anymore
- the disc is read twice when the discId is not found on MusicBrainz
- the script only asks for the password when actually submitting


@sbontrager:
libcdio support is possible, but I don't have time for a new backend right now

I had a look and pycdio doesn't seem to be of much help for getting ISRCs (which are mostly not in the CD-TEXT). I also would prefer not having another lib as dependency.
It shouldn't be much of an issue to just parse the output of "cd-info" directly This is what I am doing with the other backends anyways.

I opened a ticket for libcdio support: https://github.com/JonnyJD/musicbrainz- … /issues/22 (due for 0.5)

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

Updated to version 0.4.3:

- stab support

Sometimes there is no release on MB, but only a stab. Previous versions would crash. The script now displays the stab information and lets the user submit it as a "real" release.

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

There is no link with Windows tools?
Why is this sticky and not the other?  (T_T)
The enhancements from here can’t got there?

(\ (\         mb. PUNBB FORUMS ENHANCER
( ^_^)..   LA TÉLÉ FAIT GROSSIR ET NUIT À L’ÉVEIL DU CERVEAU

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

I linked http://musicbrainz.org/doc/ISRC#Resources in the first thread now.

The windows tool you linked works very different, so it can't use the improvements here directly.
Is anything wrong with the windows tool? I am not catering to windows with this script basically because this is done better with isrcsubmit.exe.
If there is any tool I can use from windows commandline to extract the ISRCs I could make my script to work for windows. The backend is the only thing that is platform dependent.

I normally don't use windows, but I could do some testing in a virtual machine if there is an actual demand for a windows support of my script.

8 (edited by JonnyJD 2012-12-01 21:30:02)

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

Updated to version 0.4.4:

bugfix concerning empty ISRCs in CD-TEXT (with cdrdao)
bugfix concerning mismatched discs on releases with bonus DVDs
usabilty fix: no backtraces on invalid user input

EDIT:
Windows/mediatools and libcdio support will come with 0.5. Both are already in the master branch, but need more testing.

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

Updated to version 0.5:

- added Windows to supported platforms
- added mediatools/media_info to supported backends (windows)
- added libcdio to supported backends
- added parameter for the browser (default is still firefox)
- the username is now an optional parameter (-> all parameters are optional now!)

Windows users can use isrcsubmit.bat to start the script in a terminal and should make a link to that (on desktop or anywhere). With this link they can then also set default parameters.

Mac still works, but is still VERY slow. There doesn't seem to be a good tool to gather ISRCs on Mac.
There is only one download for Mac that includes universal libraries now.

10 (edited by JonnyJD 2012-12-12 17:38:49)

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

A quick update on the project:

I am working on 0.5.1, fixing some windows bugs and adding a better/faster Mac backend: discisrc.
This is a tool from the isrc branch of libdiscid and the tool itself can (currently) be downloaded from: (link doesn't work, see next post)

Uploads are disabled at github right know so the downloads will be available somewhere else soon. Probably at jonnyjd.net or kraehen.org.
Currently they are still at https://github.com/JonnyJD/musicbrainz- … /downloads, but I can't upload any new files.

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

That discisrc upload is broken (probably because uploads were disabled the same day).

New discisrc download: http://isrcsubmit.jonnyjd.net/downloads … rc-mac.zip
This time it is only a static 64 bit intel build. The dynamic build had problems finding the libraries..

Since I have to decide where to put the downloads and change the corresponding web page, 0.5.1 takes a bit more time.

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

Updated to version 0.5.1:
- unicode support on Windows
- fix: exception on browser error
- fix: device debug output Windows
- fix: detect broken "which" tool

Unicode support works in Windows when the console (cmd) is set to the "Lucida Console" font and
either isrcsubmit.bat is used or you set the codepage to utf manually with "chcp cp65001" manually before using isrcsubmit.py.

You have to set the codepage back after using isrcsubmit (or exit the shell), because on Windows there are some bugs with unicode support. "chcp" shows you your current codepage.

Also there is more information available on the website now: changes, backends.

Downloads are now at http://jonnyjd.github.com/musicbrainz-i … t/download

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

Wow your MB colours webpage ! Nice :)

(\ (\         mb. PUNBB FORUMS ENHANCER
( ^_^)..   LA TÉLÉ FAIT GROSSIR ET NUIT À L’ÉVEIL DU CERVEAU

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

Updated to version 1.0.0:
- added discisrc backend (finally a good backend for Mac!)
- the release choice starts with index number 1, rather than 0
- update libdiscid to 0.4.1 for Mac and Windows packages

I should note that Mac users should use the included isrcsubmit.sh (also works in Linux)
and Windows users should use isrcsubmit.bat.

There is more information available on the website:  changes, backends.

Downloads are at http://jonnyjd.github.com/musicbrainz-i … t/download


With the 1.0.0 release isrcsubmit (version 1) should be stable now and won't get new features (unless they seem very important).
Version 1 will still be maintained and receive bug fixes.
I will work on isrcsubmit version 2, now. That version should work with WS/2 directly and use libdiscid as an ISRC backend.

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

Updated to version 1.0.1:
- #52: fix error messages using discisrc with no isrcs
- #51: fix IndexError when release status is unknown

Downloads at:
http://jonnyjd.github.com/musicbrainz-i … t/download


You can already try isrcsubmit version 2 in the master branch of
https://github.com/JonnyJD/musicbrainz-isrcsubmit
That one is in beta state, I'd say. You can try this if you have problems with multi-disc releases.
Please report bugs/problems if you find any.

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

Pre-release of isrcsubmit 2

On http://jonnyjd.github.com/musicbrainz-i … t/download
a pre-release of isrcsubmit version 2 can be downloaded.
(currently 2.0.0-beta.1)

This version works with the new Web Service (WS/2) and uses python-musicbrainzngs and python-discid
and can be used with either Python 2 or Python 3.
ISRCs are currently still taken from the usual backends (not from libdiscid directly yet).
Otherwise this should work fine already.

Please report Bugs to Github


The stable version is still isrcsubmit 1.0.1.

17 (edited by JonnyJD 2013-04-27 12:37:57)

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

There is a new pre-release: 2.0.0-beta.2

On http://jonnyjd.github.com/musicbrainz-i … t/download
the pre-release of isrcsubmit version 2 can be downloaded.

ISRCs are now taken from libdiscid directly.
The cd-info, cdda2wav/icedax and drutil backends are removed. cdrdao is still included for CD-TEXT ISRCs and mediatools for raw reads (in development for libdiscid). discisrc can also still be used (possibly a test version), but is not included in the mac package.

Please report Bugs to Github


The stable version is still isrcsubmit 1.0.1.

EDIT:
I forgot, there are also bug fixes in this release: Actual submission seemed to be broken and there are also fixes for Mac devices.

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

Today there is a new stable release (1.0.2) and a new beta release (2.0.0-beta.3):

Changes in 1.0.2 (stable):
- #58 allow/fix non-ascii passwords (UTF-8 passwords work now)

Changes in 2.0.0-beta.3 (pre-release):
- Windows/Mac builds include updated libdiscid (0.5.1) and musicbrainzngs (0.4)
- Added --server parameter to be able to use musicbrainz beta or test
- Added --release-id to skip the release selection
- Fix submission for musicbrainz 0.4 (this is the minimum supported musicbrainzngs version now)
- Added --force-submit parameter. You can now use this as a simple disc ID submission script
- finds a browser automatically now


On http://jonnyjd.github.com/musicbrainz-i … t/download
both releases can be downloaded.

Please report Bugs to Github

19 (edited by JonnyJD 2013-06-27 12:32:02)

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

There is a new beta release available:

Changes in 2.0.0-beta.4 (pre-release):
- adapt API for python-discid 1.0.0 (which is now stable)
- ship python-discid 1.0.0 in the Windows and Mac packages

You should upgrade at the same time you upgrade to python-discid >= 1.0.0.
Sorry for any inconvenience, but this is still a beta release and so was the previos python-discid version.

There is basically only one open question until the final isrcsubmit version 2 can be released:
https://github.com/JonnyJD/musicbrainz- … it/pull/66
This is about whether it should be supported to use isrcsubmit as a module for another python script/program and if so, I would have to make some of the code a stable API.
EDIT:
python-musicbrainz-ngs possibly also isn't stable, but I am not sure when that will happen or if it is supposed to be stable. When there is a plan for that, I might or might not wait for the library to become stable.

download at: http://jonnyjd.github.com/musicbrainz-i … t/download
Please report Bugs to Github

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

This new version does not seem to work nicely with Ubuntu 13.04. When run, I get this output:

  File "/usr/local/bin/isrcsubmit.py", line 41, in <module>
    import discid
ImportError: No module named discid

I can't seem to find a package in the Ubuntu tree which provides discid. It has no python-discid package in the standard repositories. A search suggests phtyon-cddb but it doesn't resolve the import. Will we need to install python-discid as well?

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

Debian/Ubuntu for some reason doesn't ship python-discid, but created a new project python-libdiscid, which is mostly compatible though.
I will release a new beta that works with both.

You can however get python-discid from a PPA: https://launchpad.net/~jonnyjd/+archive/python-discid
There are also possibilities for other Linux distributions on https://python-discid.readthedocs.org/e … 2/install/

I want to note that you don't have to care about the libdiscid dependency anymore then, because that is handled by python-(lib)discid.

I will update the installation instructions when isrcsubmit version 2 is ready.
(Didn't have time for that yet, there is a blocking issue)

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

The PPA fixes that problem for me - thanks. It led to another hurdle. Apparently, Ubuntu 13.04 also has an older version of musicbrainzngs, which is missing an import called AuthenticationError. I've also replaced that module; there's no PPA I can find for it, but I uninstalled the distribution version and replaced it with the current version from https://github.com/alastair/python-musicbrainz-ngs/ .

Unfortunately, I'm still stuck. 'cdrdao' doesn't want to behave on my system, and refuses to extract the TOC. cd-info can read it fine, but isn't supported by isrcsubmit.py . I'll keep at it.

Thanks for your quick response. I'll post back if I can resolve the cdrdao issue.

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

Technically

isrcsubmit.py --backend libdiscid

works.
However, the version of libdiscid is also outdated in raring. It already was outdated when raring was released. That has to do with the feature freeze for the Debian release (wheezy) that was going on at that time. You need libdiscid 0.3.1 or higher to read ISRCs directly with libdiscid.

The reason the cd-info bakend was dropped, is that it has no benefit over using libdiscid for ISRC extraction.

I would be interested in what problems you run into with cdrdao exactly.

Sorry for all these packaging inconveniences.
Dependencies like these are a reason why it is still easier to use isrcsubmit version 1 on some Linux distributions :-/
If you install the newer dependencies, version 2 is better though.

All of these dependencies should probably be bundled in a MusicBrainz PPA.
There is one, but it currently only includes Picard.

Re: ISRC submission for Linux, Windows and Mac OS X (python, console)

I think there were several problems with cdrdao. It would sometimes report that the CD was busy, and if I resolved that issue, isrcsubmit.py would just bail with "ERROR: cdrdao returned with 1". If I run cdrdao directly I would see something like:

$ cdrdao read-toc --device /dev/sr0 x.toc
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas@daneb.de>
ERROR: Unable to open SCSI device /dev/sr0: Device or resource busy.
ERROR: Please use option '--device {[proto:]bus,id,lun}|device', e.g. --device 0,6,0, --device ATA:0,0,0 or --device /dev/cdrom
ERROR: Cannot setup device /dev/sr0.

The first one was that it would not read the CD if another process had it locked; it appears Gnome routinely does this for CDs by launching gvfsd-cdda . The other problem seems to have been triggered by the system auto-mounting the CD. The mount point is one from a Live DVD I had mounted a few days ago, but for some reason the mount persisted (even though i've rebooted several times since then). When I unmounted the CD, cdrdao and isrcsubmit.py started working.

I can't figure out why the system was hanging on to the DVD mount point, but unmounting it seems to resolve things with cdrdao . The CD itself is a plain audio CD (no data tracks), so there was nothing really for it to read. If I have more problems, I'll give libdiscid a try (but as  you say, the stock version on this system doesn't work so I'll need to install a newer version).

Thanks, JonnyJD.