Jack

June 14, 2022 · View on GitHub

Jack is command-line CD ripper. It extracts audio from a CD, encodes it using 3rd party software and augments it with metadata from various sources.

As all CLI things, Jack is fast and efficient, and that's why we like it.

Recent features

  • port to Python 3
  • replace CDDB.py with libdiscid
  • replace eyeD3 with mutagen
  • add support for MusicBrainz while keeping support for freedb/gnudb
  • add support for extended tagging, compatible with MusicBrainz Picard
  • add support for M4A, using fdkaac and mutagen
  • transcoding from lossless to lossy formats
  • automatic downloading of album art from coverartarchive, iTunes and discogs
  • automatic, highly configurable embedding of album art

Requirements

  • Python 3
  • libdiscid, a shared library written in C
  • a Python 3 wrapper for libdiscid, either python-libdiscid or python-discid
  • Python 3 modules mutagen, requests, pillow and python-dateutil
  • an encoder like oggenc (Ogg/Vorbis), flac, lame (MP3) or fdkaac (M4A/AAC)
  • a ripper like cdparanoia (recommended), cdda2wav, dagrab or tosha

Usage

jack [option]...

Options of type bool can be negated with --no-[option]. Options that take an argument get that argument from the next option, or from the form --[option]=[argument]. Options that take a list argument take that list from the following arguments terminated with ';', the next option or the end of the options.

OptionTypeDefault valueDescription
--debugboolnoshow debug information
--debug-writeboolnowrite debug information to a file
--ripperstr'cdparanoia'which program to use for extracting the audio data

use which program to rip: cdparanoia, tosha, cdda2wav, dagrab (untested)
--devicestr'/dev/cdrom'use which device for ripping
--encoder-name, -Estr'oggenc'use which encoder

this is a symbolic name (see helpers), NOT the executable's name
--vbr, -vboolyesgenerate variable bitrate files

use variable bitrate for encoders which support it
--qualityfloat6vbr encoding quality. -1 is lowest, 10 highest.
--bitrate, -bint160target bitrate in kbit/s

default bitrate
--serverstr'musicbrainz'use which metadata server

your metadata server, see metadata_servers
--rename-fmtstr'%a - %l - %n - %t'format of normal files

specify how the resulting files are named:
%n: track number
%a: artist
%t: track title
%l: album title
%y: album release year - individual track years are unsupported
%Y: smart year - transforms to the append_year template if year is set
%g: album genre - individual track genres are unsupported
--rename-fmt-vastr'%l - %n - %a - %t'format of Various Artists files

specify how the resulting files are named:
%n: track number
%a: artist
%t: track title
%l: album title
%y: album release year - individual track years are unsupported
%Y: smart year - transforms to the append_year template if year is set
%g: album genre - individual track genres are unsupported
--rename-numstr'%02d'track number format for %n, printf() style
--rename-dirboolyesrename directory as well
--append-yearstr''append this string to the directory name
--dir-templatestr'%a/%l'if directories are renamed, this is the format used

specify how the resulting files are named:
%a: artist
%l: album title
%g: album genre - individual track genres are unsupported
%y: album release year - individual track years are unsupported
%Y: smart year - transforms to the append_year template if year is set
%d: disc number
%D: number of discs
%t: disc title
--dir-multi-cd-templatestr'%a/%l (CD %d)'dir_template, if album consists of multiple discs

specify how the resulting files are named:
%a: artist
%l: album title
%g: album genre - individual track genres are unsupported
%y: album release year - individual track years are unsupported
%Y: smart year - transforms to the append_year template if year is set
%d: disc number
%D: number of discs
%t: disc title
--dir-multi-cd-unknown-number-templatestr'%a/%l (CD %d)'dir_template, if album consists of multiple discs, and the number of discs is unknown

specify how the resulting files are named:
%a: artist
%l: album title
%g: album genre - individual track genres are unsupported
%y: album release year - individual track years are unsupported
%Y: smart year - transforms to the append_year template if year is set
%d: disc number
%D: number of discs
%t: disc title
--dir-titled-cd-templatestr'%a/%l (CD %d: %t)'dir_template, if album consists of multiple discs, and the current disc has a title

specify how the resulting files are named:
%a: artist
%l: album title
%g: album genre - individual track genres are unsupported
%y: album release year - individual track years are unsupported
%Y: smart year - transforms to the append_year template if year is set
%d: disc number
%D: number of discs
%t: disc title
--dir-titled-cd-unknown-number-templatestr'%a/%l (CD %d: %t)'dir_template, if album consists of an unknown number of multiple discs, and the current disc has a title

specify how the resulting files are named:
%a: artist
%l: album title
%g: album genre - individual track genres are unsupported
%y: album release year - individual track years are unsupported
%Y: smart year - transforms to the append_year template if year is set
%d: disc number
%D: number of discs
%t: disc title
--file-artiststr'as-in-mb'which MusicBrainz artist name to use for filenames

valid arguments are 'as-in-mb' (default), 'as-credited' or 'as-sort-name'
--add-disambiguationboolnoadd disambiguation to the album title
--char-filterstr''convert file names using a python method

an example which converts to lowercase, even with non-ascii charsets: ".lower()"
--charsetstr'UTF-8'charset of filenames

examples: latin-1, utf-8, ...
--unusable-charslist['/', '\r']characters which can't be used in filenames

put chars which can't be used in filenames here and their replacements
in replacement_chars.

example 1: replace all " " by "":
unusable_chars = " "
replacement_chars = "
"

example 2: replace umlauts by an alternate representation and kill some
special characters:
unusable_chars = "äöüÄÖÜß?*^()[]{}"
replacement_chars = ["ae", "oe", "ue", "Ae", "Oe", "Ue", "ss", ""]
--replacement-charslist['%', '']unusable chars are replaced by the corresponding list item

this is stretched to match unusable_chars' length using the last char as fill
--scan-dirsint2scan in cwd n dir levels deep, e.g. 0 to disable
--searchlist['.']search which directories
--workdir, -wstr'.'where to create directories and put the files
--max-loadfloat10.0only start new encoders if load < max_load
--usage-winboolyesshow the help screen while running
--encoders, -eint1encode how many files in parallel
--otfboolnoon-the-fly encoding *experimental*
--create-dirs, -Dboolyescreate subdir for files
--reorder, -rboolnoreorder tracks to save space while encoding
--keep-wavs, -kboolnodo not delete WAVs after encoding them
--only-dae, -Oboolnoonly produce WAVs, implies --keep_wavs
--read-ahead, -aint99read how many WAVs in advance
--nice, -nint12nice-level of encoders
--overwrite, -oboolnooverwrite existing files
--remove-filesboolnoremove jack.* file when done
--silent-modeboolnobe quiet (no screen output)
--exec, -xboolnorun predefined command when finished
--forceboolnodon't ask.
--swab, -Sboolyesswap byteorder when reading from image
--todoboolnoprint what would be done and exit
--space, -sint0force usable disk space, in bytes
--check-tocboolnocompare toc-file and cd-toc, then exit
--undo-rename, -uboolnoundo the last file renaming and exit
--dont-work, -dboolnodon't do DAE, encoding, renaming or tagging
--update-metadata, -Uboolnoupdate the metadata info and exit
--refresh-metadataboolnoforget about choices made in previous queries
--tracks, -tstr''which tracks to process (e.g. 1, 3, 5-9, 12-)
--query-now, -Qboolnodo metadata query when starting
--query-if-neededboolnoquery metadata server when starting if not queried already
--query, -qboolnodo metadata query when all is done
--cont-failed-queryboolnocontinue without metadata data if query fails
--edit-metadataboolnoedit metadata information before using it
--variousbool-assume CD has various artists
--various-swapboolnoexchange artist and title
--extt-is-artistboolnoextt contains artist
--extt-is-titleboolnoextt contains track title
--extt-is-commentboolnoextt contains track comment
--rename, -Rboolnorename according to metadata file, eg. after editing it
--lookupboolnostart a browser and look up the CD
--set-dae-tagboolnoset DAE info tags

depends on set_extended_tag
--genre, -Gstr-overrule genre from metadata
--year, -Ystr-overrule year from metadata (0=don't set)
--from-tocfile, -fstr-read another toc file which may point to an image-file
--from-image, -Fbytes-read audio from an image file
--guess-toc, -glist[]guess TOC from files (until terminating ";")
--upd-progressboolnore-generate progress file if "lost"
--multi-modeboolnotry to query metadata server for all dirs in searchdirs which have no metadata
--claim-dir, -Cboolnorename the dir even if it was not created by jack
--waitboolnowait for key press before quitting
--saveboolnosave options to rc file and exit
--getstr-show value of a config option
--write-m3uboolnocreate a playlist in .m3u format
--download-progress-intervalint5interval in seconds for showing progress of slow downloads, zero is no progress
--embed-albumartboolnoembed album art
--show-albumartboolnoshow the album art that has been embedded in an external viewer
--albumart-filestr-specific album art file to embed
--albumart-searchlist['.*[Cc]over.*\.(jpg|jpeg|png)$', '.*[Ff]ront.*\.(jpg|jpeg|png)$', '^[Ff]older\.(jpg|jpeg|png)$', '^jack\.caa\.front.*\.jpg$', '^jack\.itunes.*\.jpg$', '^jack\.discogs.*\.jpg$']list of regex patterns for matching local album art files
--albumart-ignorecaseboolyesignore case when searching for local album art
--albumart-recurseboolnorecurse into subfolders when searching for local album art
--albumart-max-sizeint1000000maximum size when considering album art file
--albumart-min-sizeint5000minimum size when considering album art file
--albumart-max-widthint1200maximum width when considering album art file
--albumart-min-widthint250minimum width when considering album art file
--albumart-max-heightint1200maximum height when considering album art file
--albumart-min-heightint250minimum height when considering album art file
--albumart-save-prefixstr'jack.saved.'prefix for saving existing embedded album art
--fetch-albumartboolnodownload album art while querying
--overwrite-albumartstr'conditional'whether to overwrite existing album art files, 'always', 'never' or 'conditional' (the default)
--albumart-providerslist['coverartarchive', 'iTunes', 'discogs']list of sources for album art, currently 'coverartarchive', 'iTunes' or 'discogs'
--caa-albumart-prefixstr'jack.caa.'prefix for saving fetched album art files from coverartarchive
--caa-albumart-sizeslist['original', 'large']list of album art sizes to download from coverartarchive: 'original', 'small', 'large', '250', '500' or '1200'
--caa-albumart-typeslist['front']download these album arts from coverartarchive ('front' and/or 'back')
--itunes-albumart-sizeslist['standard', 'high']list of album art sizes to download from iTunes: 'thumb', 'standard' or 'high'
--itunes-albumart-limitint1limit number of matches when querying for iTunes album art, zero is no limit
--itunes-albumart-countrystr'us'two letter country code of iTunes store to query
--itunes-albumart-prefixstr'jack.itunes.'prefix for saving fetched iTunes album art files
--discogs-albumart-prefixstr'jack.discogs.'prefix for saving fetched discogs album art files
--discogs-albumart-typeslist['primary']download these album arts from discogs ('primary' and/or 'secondary')
--discogs-albumart-tokenstr-discogs personal authentication token
--readmestr-export README.md to given file

Interaction

While Jack is running, press q or Q to quit, p or P to disable ripping (you need the CD drive) p or P (again) or c or C to resume, e or E to pause/continue all encoders and r or R to pause/continue all rippers.

Authors and Copyrights

Jack is Free Libre Open Source Software distributed under the GNU General Public License version 2, or (at your option) any later version.

The original home of the project was http://www.home.unix-ag.org/arne/jack/ and the code was hosted in SourceForge.

Jack has first been developed by the following authors, be they praised:

Contributions

Pull Requests and contributions in general are welcome.