Skip to main content

Extract tags from filename and/or fetch album name/cover from Google Search

Project description

MP3NORM

Simple script written in Python that extract tags from filename and/or fetch album name/cover from Google Search.

REQUIREMENTS

  • eyed3
  • sacad (only for download albums covers)
  • selenium (only for fetch albums names)

INSTALLATION

pip install mp3norm

or

git clone https://github.com/Docheinstein/mp3norm

USAGE

Run with

python -m mp3norm

or

mp3norm
python mp3norm.py [-h] [-e [REGEX]] [-E [REGEX]] [-a] [-A] [-c [RESOLUTION]] [-C [RESOLUTION]] [-v] [-d GECKODRIVER] [-s] [input]

positional arguments:
  input                 .mp3 file or folder containing the .mp3 files (default is current directory)

optional arguments:
  -h, --help            show this help message and exit
  -e [REGEX], --extract [REGEX]
                        Extract tags from filename if those are missing, using the optional regex (default is "((?P<artist>.*) - )?(?P<title>.*).mp3")
  -E [REGEX], --force-extract [REGEX]
                        Extract tags from filename (always overwriting the previous values), using the optional regex (default is "((?P<artist>.*) - )?(?P<title>.*).mp3")
  -a, --album           If the album tag is missing, tries to retrieve the album name (requires selenium)
  -A, --force-album     Always tries to retrieve the album name (requires selenium)
  -c [RESOLUTION], --cover [RESOLUTION]
                        Download the cover, if it is missing, download it using the optional given resolution (default is 600) (requires sacad)
  -C [RESOLUTION], --force-cover [RESOLUTION]
                        Always download the cover using the optional given resolution (default is 600) (requires sacad)
  -v, --verbose         Print more messages
  -d GECKODRIVER, --driver GECKODRIVER
                        Path of the geckodriver (required if --album is given)
  -s, --show-driver     Show the selenium web driver, if used

EXAMPLES

  • Extract the mp3 tags for each mp3 file (with the format "<artist> - <title>.mp3)")
mp3norm /home/user/Music -e
  • Fetch the album name for each mp3 file
mp3norm /home/user/Music -a
  • Download the cover for each mp3 file
mp3norm /home/user/Music -c -d /opt/geckodriver/geckodriver
  • Extract the mp3 tags, automatically fetch album name and cover
mp3norm /home/user/Music -e -a -c -d /opt/geckodriver/geckodriver
  • Force to extract the mp3 tags, automatically fetch album name and cover
mp3norm /home/user/Music -E -A -C -d /opt/geckodriver/geckodriver
  • Extract the mp3 tags for a mp3 file with a non-default pattern
mp3norm "/home/user/Music/Fleetwood Mac - Rhiannon.mp3" -e "(?P<artist>.*)-(?P<title>.*)"
  • Extract different mp3 tags for a mp3 file with a non-default pattern
mp3norm "Pink Floyd - The Dark Side of the Moon - Money.mp3" -e "(?P<artist>.*) - (?P<album>.*) - (?P<title>.*)"

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

mp3norm-0.6.tar.gz (9.5 kB view details)

Uploaded Source

File details

Details for the file mp3norm-0.6.tar.gz.

File metadata

  • Download URL: mp3norm-0.6.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/56.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.4

File hashes

Hashes for mp3norm-0.6.tar.gz
Algorithm Hash digest
SHA256 39a9bb3016aaead6d8d93f6df70edfdd8baf5649dea4c21d4443a0ea2b8bceea
MD5 cd5b585c164fa0986d4e9aacbf8d589a
BLAKE2b-256 aacd9a29cb32ae95cbfec9f55db6e9b740d6a997eefcf19ec7669f1a57393605

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