Code Monkey home page Code Monkey logo

apit's Introduction

apit

Build Status

RUN THIS AT YOUR OWN RISK! MAKE A BACKUP BEFORE RUNNING THIS!

apit allows batch tagging .mp3 and .m4a (AAC and ALAC) file metadata tags using data from Apple Music/iTunes Store.

Installation

Requirements

At least Python 3.11

apit Installation

$ cd apit-source-code/  # i.e. this folder
$ pip install .

Usage

Command line help

$ apit -h

Print the current metadata

$ apit list ~/Music/Music/Media/Artist/Album/

Tag the music files' metadata using data from Apple Music/iTunes Store

Example using an url:

$ apit tag ~/Music/Music/Media/Artist/Album/ https://music.apple.com/us/album/album-name/123456789

Example using an already downloaded metadata file:

$ apit tag ~/Music/Music/Media/Artist/Album/ ~/Desktop/Artist-Album-123456789.json

Filename format requirements

The filename of your files must have the following format in order to match them against the Apple Music/iTunes Store metadata:

  1. optional: disc number (followed by "-" or ".")
  2. required: track number (followed by an optional ".")
  3. required: .mp3 or .m4a extension

Examples:

  • without disc number (defaults to disc 1)
    • 14.m4a, 14 title.mp3, 14. title.m4a, #14.m4a, #14 title.m4a
    • 2. 14 title.m4a (track 2: title contains the number 14)
  • with disc number (e.g. disc 2)
    • 2-14 title.m4a, 2.14 title.mp3, 2.14. title.m4a

Metadata source requirement

You must provide a source for the metadata to be used. Simply search for the album matching your files in the Apple Music/iTunes Store functionality or in a search engine and copy & paste the url to that album. The format of that url must match the following form (as of 2020-05 using Apple Music on macOS 10.15 Catalina):

https://music.apple.com/{COUNTRY_CODE}/album/album-name/{ID}
e.g. https://music.apple.com/us/album/album-name/123456789

or the old style iTunes format:

http://itunes.apple.com/{COUNTRY_CODE}/album/album-name/id{ID}
e.g. http://itunes.apple.com/us/album/album-name/id123456789

Even this format will match:

http://x/us/x/9/123456789?i=09876

This will look up the metadata of the album with the ID 123456789 in the US store of Apple Music/iTunes.

Attention: Beware of album variations (e.g. deluxe editions)

You should compare your files against the album's metadata you found via the iTunes Store or a search engine. Sometimes the songs' track order vary from album edition to album edition (e.g. deluxe edition) or the album published in another country has a different order. This means that your files will be tagged using the wrong metadata if you choose the wrong edition! You can overcome this by renaming your files before tagging to match against the appropriate metadata. Optionally, you can edit your files' track number metadata again after tagging to revert to your original track order.

Artwork

By default, artwork from Apple Music/iTunes Store is saved to your files. Additionally, you can specify your desired pixel size (default: 600).

Examples:

$ apit tag ~/Music/Music/Media/Artist/Album/ https://music.apple.com/us/album/album-name/123456789
$ apit tag --artwork-size 1000 ~/Music/Music/Media/Artist/Album/ https://music.apple.com/us/album/album-name/123456789

Create backup files

You can create backup files before updating metadata if you put --backup (short: -b) in your command.

$ apit tag --backup ~/Music/Music/Media/Artist/Album/

Verbose mode

To see more information what happens you can put -v into your command. Using -vv enables debug output.

$ apit tag -v ~/Music/Music/Media/Artist/Album/

apit Development

Develop mode

Install apit in an editable mode:

$ pip install --editable ".[dev]"

This will install tox and other development tools. Tox is used to run for example tests in an isolated environment. Show all possible actions using:

$ tox -a

Running a specific tox command will install its necessary dependencies in separate virtualenvs.

Code style is ensured using a pre-commit hook:

$ pre-commit install

Building

$ tox -e build

apit's People

Contributors

wschott avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

apit's Issues

missed tags

Hi
new version has missing tags unlike the old version (AtomicParsley based)
artistid, iTunes genreid, iTunes playlistid and some others.
Maybe you can add missing tags to the new version?
Regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.