Skip to main content

Fix mp3 tags to use in iTunes/iPhone audiobooks.

Project description

Build Status Coverage

Audiobooks from mp3 with broken tags

Fix mp3 files tags to convert them into iTunes/iPhone audiobooks..

  • Fixes sort order.
  • Supports messed encoding like cyrillic Win1251.

Details in my blog's article.

Installation

Install using pipx for isolated environments, which prevents interference with your system's Python packages.

Once pipx is set up:

pipx install audiobook-tags

Command Line Interface

Usage

audiobook-tags [-h] [--encoding ENCODING] [--extension EXTENSION] [--set-tag [SET_TAG ...]] [--track-num TRACK_NUM] [--title-prefix TITLE_PREFIX] [--dry] [folder]

Fixes mp3 tags for iOS audiobooks.

positional arguments:
  folder                Folder to process. By default current folder.

options:
  -h, --help            show this help message and exit
  --suffix SUFFIX, -s SUFFIX
                        Files suffix. By default mp3
  --encoding ENCODING, -e ENCODING
                        mp3 tags encoding. "none" if you do not need mp3 tags encoding fix. By default "cp1251".
  --tag [SET_TAG ...], -t [SET_TAG ...]
                        Change mp3 tag to specified string. Format "tag-name/tag-value".
  --num TRACK_NUM, -n TRACK_NUM
                        Sort files and set mp3 tag `track_num`:
                          --num="name" - sort by names;
                          --num="tag-<TAG>" - sort by mp3 tag with name <TAG>.
                            For example to sort by title tag use --num="tag-title".
  --prefix TITLE_PREFIX, -p TITLE_PREFIX
                        Add prefix to title tags. By default `{track:04} - ` if `--num` and no prefix if not.
  --dry, -d             Dry run without changing files.

Example:

audiobook-tags --tag="album_artist/Юрий Заборовский (Ардис)" --num="name" --prefix=""
  • converts all mp3 files in current folder and subfolders
  • fix encoding supposing that original encoding was Windows 1251
  • change tag album artist.
  • set track_num mp3 tag to file number as ordered by file name. But do not add the track number to the title (--prefix=""").

Development

OS Dependencies

MacOS

brew update brew install libmagic

Python dependencies

Note the dot before ./activate.sh:

. ./activate.sh

We use eyeD3 to work with mp3 tags.

Coverage report

Created with cookiecutter using template

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

audiobook_tags-1.2.9.tar.gz (7.1 MB view details)

Uploaded Source

Built Distribution

audiobook_tags-1.2.9-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file audiobook_tags-1.2.9.tar.gz.

File metadata

  • Download URL: audiobook_tags-1.2.9.tar.gz
  • Upload date:
  • Size: 7.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for audiobook_tags-1.2.9.tar.gz
Algorithm Hash digest
SHA256 cbfc7c2aa0d71f5426b48f32a9afd1dc4485edff73a694d0142e884e6da9db97
MD5 ceff2504118cec286eecf24483a1f849
BLAKE2b-256 2accce329f16c226d3cf2ce580b4c27cc2b88258d2fbf5806a333ec8997e2123

See more details on using hashes here.

File details

Details for the file audiobook_tags-1.2.9-py3-none-any.whl.

File metadata

File hashes

Hashes for audiobook_tags-1.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1487b84208a140b1b9d62b08141def3afab6229c985893360ce4fa6bdae64203
MD5 c5e4e8499f9f1fedbbb0cead54cce0b4
BLAKE2b-256 f75140e9c55cf010126a440ae9e6d8e367fcb18556bf75dd5f75609fde4f3c18

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page