Git Product home page Git Product logo

flac2lib's Introduction

flac2lib is a simple script I've made (and then expanded with like a milion random ideas) for myself for easier music library management, specifically batch converting flac files into mp3 with regard to my mp3 music library schema.

Prerequisites

Installation

Download the files

  • Clone the repo:
git clone https://github.com/PokerFacowaty/flac2lib
  • ... or simply download flac2lib.py and config.yaml and store them in the same directory

Configuration

config.yaml

  • Open config.yaml
  • By default, the file will look like this:
# Docs: https://github.com/PokerFacowaty/flac2lib
flac_albums_dir:
dst_albums_dir:
entire: False
num_albums_to_show: 10
dir_name_prompts: True
latest: False
get_cover_art: True
default_cover_art_name: cover # copied straight to the album folder
cover_art_suffixes: ['jpg', 'png', 'jpeg']
destination_format: mp3
ffmpeg_params: -q:a 2
# For the MP3 preset, use the "ffmpeg option" table in this article
# of the ffmpeg docs:
# https://trac.ffmpeg.org/wiki/Encode/MP3
# Use for other formats accordingly.

Explanations for all config entries:

  • flac_albums_dir: - the directory that contains album folders with flac files
  • dst_albums_dir: - the destination directory for converted files
  • entire: - convert entire albums without asking for a list of songs to be converted; False by default
  • num_albums_to_show - the amount of albums that should be listed when albums are presented to be chosen; 10 by default, ignored when entire: is set to True or the -e / --entire option is used
  • dir_name_prompts - prompt about album/artist folder paths, uses ARTIST and ALBUM tags for dir and subdir without asking if False; True by default
  • latest - pick the most recently modified flac folder; False by default
  • get_cover_art - copy the cover art; True by default
  • default_cover_art_name - the default name for the main cover art without its suffix; cover by default
  • cover_art_suffixes - a list of accepted covert art suffixes; ['jpg', 'png', 'jpeg'] by default
  • destination_format - the format that flacs will be converted to
  • ffmpeg_params - additional ffmpeg parameters, the preset / bitrate for MP3 should be specified here; -q:a 2 (VB2) by default

Usage

To use flac2lib, simply start it when in the same directory:

python flac2lib.py

(or if you have Python 2 installed)

python3 flac2lib.py

Arguments

  • -h, --help - show help
  • -c, --config <file> - use a custom config file
  • -e, --entire - convert the entire directory
  • -s, --source <dir> - specify the source album directory
  • -d, --destination <dir> - specify the destination album directory
  • -l, --latest - only convert the most recently modified folder in the flac albums directory
  • --skip-cover-art - skip the process of copying covert art entirely
  • --skip-dir-prompts - skip prompts about album/artist folder paths, use ARTIST and ALBUM tags for dir and subdir without asking
  • --compilation - skip the prompt about whether a compilation tag should be added, mark the album as a compilation
  • --not-compilation - see above

Possible future improvements:

  • Fixing case-sensitivity for retrieving artist and album names from tags
  • Showing covert art's size when listing
  • Fixing main cover art for multi-CD albums (is copied to the main directory and therefore usually not found by players which are looking inside the final (ex. Disc 1 directory))
  • Warning about potential non-allowed characters in filepaths (especially with Windows in mind)
  • An option to download cover art (MusicBrainz? covers.musichoarders.xyz?)
  • Marking the album as a compilation
  • Queueing files as to not wait for conversions

flac2lib's People

Contributors

pokerfacowaty avatar

Stargazers

Mike avatar  avatar

Watchers

 avatar  avatar

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.