Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for submitting ISRCs from audio files #136

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
2f39f22
Initial checkin of Digital ISRC tool.
Aug 16, 2021
cbaad57
Added preliminary MP3 support.
Aug 18, 2021
a42e1e4
Factored out common code, which is now imported
Aug 18, 2021
a855fad
Working script, successfully tested against a flac ZIP.
Aug 19, 2021
bfdd881
Additional logic to deal with missing albumartist. Checks for a commo…
Aug 19, 2021
e8d64f0
Update README.rst
SheamusPatt Aug 20, 2021
e52f2cc
Update README.rst
SheamusPatt Aug 20, 2021
1142279
Update README.rst
SheamusPatt Aug 20, 2021
f00d7d0
Merge branch 'master' of https://github.com/SheamusPatt/musicbrainz-i…
Aug 20, 2021
88eb50d
fix links
Aug 20, 2021
95abdd8
Handle more cases for release lookup.
Aug 20, 2021
baca777
Fixing consistency checks
Aug 22, 2021
7adc368
Add checks that track artists and titles match those in MusicBrainz.
Sep 5, 2021
0f3480d
Add in requirements for Digital File script.
Sep 8, 2021
fac411a
Style and spelling issues, flagged by PyCharm
Sep 9, 2021
8dfbea3
Add some defensive coding to avoid Mutagen faults or, if all else
Sep 9, 2021
359667d
Update README file.
Sep 9, 2021
31d3620
Initial changes to add isrcDigitalSubmit.py
Sep 29, 2021
df15c70
Update version - can't have it checking out the last release on top o…
Sep 30, 2021
a2689ae
Fix download locations for mutagen and unidecode.
Sep 30, 2021
36c3b67
Use plain http for ftp.musicbrainz.org - it's a redirect.
Sep 30, 2021
b859046
Missed the new libraries when creating the Windows and Mac packages.
Sep 30, 2021
fb66c02
Refactored the shared code into isrcshared.py. I thought I could get …
Oct 1, 2021
c0b9952
Adding AAC (M4A) support.
Oct 1, 2021
6794072
Fixed OggVorbis support.
Oct 1, 2021
ce69aca
Fix exception if missing ISRC on AAC, ALAC files. Bandcamp doesn't in…
Oct 1, 2021
a017bcc
Remove .idea - I think PyCharm must have added it.
SheamusPatt Oct 1, 2021
03148f7
Documentation cleanup.
SheamusPatt Oct 1, 2021
f6caba5
Synchronized versions.
SheamusPatt Oct 1, 2021
93ae5c0
Messed up an import splitting up isrcsubmit, which caused a crash in …
SheamusPatt Oct 2, 2021
2b6e129
Add new dependencies to pkg/.gitignore
SheamusPatt Oct 2, 2021
8cf828d
Update README.rst
SheamusPatt Oct 2, 2021
fd5d823
Added requirements.txt
SheamusPatt Oct 2, 2021
eb6e734
Merge remote-tracking branch 'origin/master'
SheamusPatt Oct 2, 2021
236945e
Align discid version with packaging
SheamusPatt Oct 2, 2021
b876e90
Pushed version to 2.2.2.
SheamusPatt Oct 2, 2021
a1c351c
Updated documentation, as configuration file is shared by both script…
SheamusPatt Oct 2, 2021
6757289
Fixes to build rules
SheamusPatt Oct 3, 2021
176d7fb
Added support for ISRCs inserted by the mora.jp download site. Instea…
SheamusPatt Oct 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ musicbrainz2
/*.toc
*.pyc
.tox
.idea
venv
.eggs
/build/scripts-3.9/isrcsubmit.py
/build/scripts-3.9/isrcDigitalSubmit.py
7 changes: 6 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
This is just one isrcsubmit.
There are other isrc submission tools by different people.

This project also contains isrcDigitalSubmit, a derived tool
which extracts ISRC codes from digital media instead of CDs.

The following people have contributed to this isrcsubmit.py:

Expand All @@ -27,3 +28,7 @@ The following people have contributed to this isrcsubmit.py:
Jim Patterson
Guilherme Danno
- minor fixes

The following people have contributed to isrcDigitalSubmit.py:
Jim Patterson

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#version := 2.1.0-dev
version := 2.1.0
version := 2.2.2

build:
./setup.py build
Expand All @@ -17,7 +17,7 @@ upload:
version:
sed -i -e 's/\(Isrcsubmit\s\)[0-9.]\+[0-9a-z.-]*/\1$(version)/' README.rst
sed -i -e 's/\(__version__\s=\s"\)[0-9.]\+[0-9a-z.-]*/\1$(version)/' \
isrcsubmit.py
isrcshared.py
sed -i -e 's/\(version="\)[0-9.]\+[0-9a-z.-]*/\1$(version)/' \
setup.py

Expand Down
73 changes: 59 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
Isrcsubmit 2.1.0 for MusicBrainz
Isrcsubmit 2.2.2 for MusicBrainz
================================

This python script extracts ISRCs_ from audio CDs
and submits them to MusicBrainz_.
This project includes two python scripts that extracts ISRCs
and submits them to MusicBrainz_. isrcsubmit extracts ISRCs from
Audio CDs. isrcDigitalSubmit extracts ISRCs from audio files.

This script uses python-musicbrainzngs to access the MusicBrainz API
and python-discid to create an identifier for the disc.
These scripts use python-musicbrainzngs to access the MusicBrainz API.

isrcsubmit uses python-discid to create an identifier for the disc which
is used to locate corresponding releases in MusicBrainz.

isrcDigitalSubmit uses mutagen to analyze audio files, and locates matching
MusicBrainz releases based on embedded Artist, Album and AlbumArtist tags.

The script works for Linux, Mac OS X and Windows.

Expand All @@ -15,11 +21,11 @@ The script works for Linux, Mac OS X and Windows.
Features:
---------

* read ISRCs from disc
* search for releases with the TOC of the disc
* read ISRCs from disc or audio files
* search for releases with the TOC of the disc or embedded tags
* display release information from MusicBrainz
* submit ISRCs
* submit discIds / TOCs
* submit discIds / TOCs (isrcsubmit)
* duplicate ISRC detection (local and on server)


Expand All @@ -29,23 +35,32 @@ Dependencies:
* Python 2 >= 2.6 or Python 3 >= 3.1
* python-discid_ >= 1.0.0 (or python-libdiscid_ >= 0.2.0)
* python-musicbrainzngs_ >= 0.4
* mutagen_ >= 1.45.1
* unidecode >= 1.2.0
* keyring_ (optional)

.. _python-discid: http://python-discid.readthedocs.org/
.. _python-libdiscid: http://pythonhosted.org/python-libdiscid/
.. _python-musicbrainzngs: http://python-musicbrainzngs.readthedocs.org/
.. _keyring: https://github.com/jaraco/keyring

.. _keyring: https://github.com/jaraco/keyring/
.. _mutaagen: https://mutagen.readthedocs.io/
.. _unicode: https://github.com/avian2/unidecode

Usage:
------
::

isrcsubmit.py [options] [username] [device]
isrcDigitalSubmit.py [options] [username] audioFiles ...

All arguments are optional. For detailed usage see::
All arguments are optional other than audioFiles for isrcDigitalSubmit.
AudioFiles may be zipped (so a ZIP file as distributed by the vendor can
usually be passed directly to the script).

For detailed usage see::

isrcsubmit.py -h
isrcDigitalSubmit.py -h


Windows Usage:
Expand All @@ -54,6 +69,7 @@ Windows Usage:
Windows users should use::

isrcsubmit.bat
isrcDigitalSubmit.bat


Mac Usage:
Expand All @@ -62,6 +78,7 @@ Mac Usage:
Mac users should rather use::

isrcsubmit.sh
isrcDigitalSubmit.sh

This also works on Linux.

Expand All @@ -83,8 +100,36 @@ is fetched from MusicBrainz.
If the disc is unknown, you will be given the chance to submit the ID
to the server.

Identifying Releases from Tags
------------------------------

A Digital Media release has no equivalent of a DiscID as defined for CDs.
Instead, it uses tags that are embedded in the digital media files. The
tags of interest are Album, AlbumArtist, Artist and TrackNumber. (Other
formats eg. MP3 might name these different; this discussion will use the
Vorbis tag names).

Identifying a release is most straightforward if the albumartist tag is found.
The same albumartist tag must be on all tracks. isrcDigitalSubmit will look for
a Digital Media release with that album artist and title. If more than one is found,
the user will be asked to choose.

If no Album Artist is found, the artist will be treated as an album artist.
An attempt is made to strip away any "featured artist" from tracks, either by looking
for connectors like "feat." or "duet with", or by checking for a common name that
is found on all artist name strings. If it can't identify a single artist, it will
look for a release without specifying an artist.

If all else fails, the user can point the script to a specific release by use of
the --release-id= option.

isrcDigitalRelease always verifies that the digital media release matches the MusicBrainz
release by checking for matching titles and artists and similar track times. It also
verifies that the format is "Digital Media"; it will not attach
ISRCs to releases with a different format.


"Installation":
Installation:
---------------

If you downloaded isrcsubmit as a zip package for your platform
Expand All @@ -103,7 +148,7 @@ but "python setup.py install" might work for you.
However, the backends and libraries should get
installed so that the script has access to them.

On Linux you just install the above mentioneed dependencies with
On Linux you just install the above mentioned dependencies with
the package manager of your distribution.
For Ubuntu all dependencies should be in the MusicBrainz Stable PPA,
if not in the official repositories.
Expand Down Expand Up @@ -133,7 +178,7 @@ You might find additional information about this script at the
`MusicBrainz forums`_.

.. _web page: http://jonnyjd.github.io/musicbrainz-isrcsubmit/backends
.. _MusicBrainz forums: http://forums.musicbrainz.org/viewtopic.php?id=3444
.. _MusicBrainz forums: https://community.metabrainz.org/search?q=isrcsubmit


Bugs:
Expand Down
3 changes: 2 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
# (source start file, name, description, authors, manual section).
man_pages = [
('isrcsubmit.1', 'isrcsubmit', u'isrcsubmit Documentation', [], 1),
('isrcsubmit-config.5', 'isrcsubmit-config', u'isrcsubmit Documentation',
('isrcDigitalSubmit.1', 'isrcDigitalSubmit', u'isrcDigitalSubmit Documentation', [], 1),
('isrcsubmit-config.5', 'isrcsubmit-config', u'isrcsubmit and isrcDigitalSubmit Configuration Documentation',
[], 5)
]

Expand Down
50 changes: 50 additions & 0 deletions doc/isrcDigitalSubmit.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
isrcDigitalSubmit manual page
======================

Synopsis
--------

**isrcDigitalSubmit** [*options*] [*user*] *audioFile*...

Description
-----------

:program:`isrcDigitalSubmit` extracts International Standard Recording Codes (ISRC)
from audio files and allows one to submit the data to MusicBrainz. ISRCs are used
to uniquely identifiy sound and music video recordings.

Options
-------

--version
Show program's version number and exit.
-h
Short usage help.
--help
Complete help for the program.
--debug
Show debug messages.
-u <username>, --user=<username>
MusicBrainz username, if not given as argument.
--release-id=<release_id>
Optional MusicBrainz ID of the release. This will be gathered if not given.
--browser=<browser>
Program to open URLs. This will be automatically deteced for most setups,
if not chosen manually.
--server=<server>
Server to send ISRCs to. If not given, musicbrainz.org is used.
--keyring
Use keyring if it is available.
--no-keyring
Do not use keyring.

See also
--------

:manpage:`isrcsubmit-config(5)`

Author
------

This manual was written by Sebastian Ramacher and Johannes Dewender.
:program:`isrcDigitalSubmit` was written by Jim Patterson adapted from isrcsubmit by Johannes Dewender.
8 changes: 4 additions & 4 deletions doc/isrcsubmit-config.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Description
-----------

The configuration file contains various options controlling the behavior of
:program:`isrcsubmit`. All the options given here can be overridden by passing
command line arguments to :program:`isrcsubmit`.
:program:`isrcsubmit` and :program:`isrcDigitalubmit`. All the options given here can be overridden by passing
command line arguments.

If **$XDG_CONFIG_HOME** is not set, **%APPDATA%** is used on Windows
and **~/.config** for all other systems.
Expand All @@ -25,7 +25,7 @@ This refers to the ``[general]`` section of the configuration file.

backend
^^^^^^^
Force using a specific backend to extract ISRCs from the disc. Possible
(:program:`isrcsubmit` only). Force using a specific backend to extract ISRCs from the disc. Possible
backends are: mediatools, media_info, cdrdao, libdiscid, discisrc.

browser
Expand All @@ -34,7 +34,7 @@ Program to open URLs.

device
^^^^^^
CD device with a loaded audio CD.
(:program:`isrcsubmit` only). CD device with a loaded audio CD.

keyring
^^^^^^^
Expand Down
5 changes: 5 additions & 0 deletions isrcDigitalSubmit.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off
for /f "tokens=2 delims=:." %%x in ('chcp') do set cp=%%x
chcp 65001>NUL & cmd /c "isrcDigitalSubmit.py %*" & chcp %cp%>NUL
echo.
pause
Loading