This WIP program is intended to simplify processing audiobook files.
If fetch is passed, books will be moved to <outpath>/<author>/<title>. Otherwise they will be moved to <outpath>. This will be customizable in the future.
- Copy or move audiobooks into structured folders (
Author/Title) - Fetch metadata from Audible and/or Goodreads
- Clean and overwrite file metadata
- Convert audio files to
.m4b(via ffmpeg) - Generate metadata sidecar files (
.opf,infotext) for library apps like Audiobookshelf - Combine or preserve multi-chapter audiobooks
- Batch processing
- Save and reload settings for repeated use
-
System dependencies
- ffmpeg (for audio conversion)
- Linux: clipboard utility such as
xcliporxsel(for fetch support)
-
Python libraries
pydubmutagenrequestsbeautifulsoup4pyperclippsutil
-I, --input <path>
Required. Path to input folder containing audiobook files.-O, --output <path>
Destination folder. Defaults to<input>/Ultimate Output.-M, --move
Move files instead of copying (default is copy).
-FM, --fetch [audible|goodreads|both]
Interactive metadata fetch. Opens browser search, paste the correct link to continue.-CL, --clean
Overwrite metadata with fetched info.-CR, --create [INFOTEXT|OPF]
Generate metadata sidecar files.-FO, --force
Overwrite existing sidecar files (not yet implemented).
-CV, --convert
Convert all non-M4B files to.m4b(requires ffmpeg).
Note: Combine and Preserve processing modes can be used on libraries of mixed whole book files and chapter files as long as every book has its own folder
-RF, --recurseFetch
Process all files in input and subfolders as separate books.-RC, --recurseCombine
Combine chapter files within subfolders into complete books.-RP, --recursePreserve
Treat subfolder files as chapters without combining (not yet implemented).
-B, --batch <int>
Max number of books per run. Default = 10.-Q, --quick
Skip settings confirmation (for scripting).-LL, --logLevel [DEBUG|INFO|WARNING|ERROR|CRITICAL]
Set logging verbosity. Default = INFO. Useful for debugging or reducing console output.-S, --save/-L, --load/-D, --default
Save, load, or reset settings (not yet implemented).-RN, --rename
Rename files using a template (not yet implemented).
Clone this project, set working directory to Main in term, run Main.py with args. Examples below.
The most basic use. All audio files in the root input folder will be processed as individual books and copied to "c:\some\input\folder\Ultimate Output". Files in subdirectories will be ignored.
Main.py --input c:\some\input\folder
With the root folder "c:\some\input\folder", this will fetch metadata interactively, clean the file metadata, create an infotext metadata file, and move the books to "c:\some\input\folder\Ultimate Output\<author>\<title>". This will be done to all books in the input folder and any subfolders until completion or the batch size has been reached.
Main.py --clean --create infotext --fetch both --move --recurseFetch --input c:\some\input\folder
With the root folder "c:\some\input\folder", this will set the batch size to be virtually infinite, recursively combine and process all chapter files, and output them to "c:\some\output\folder". It will also save the settings used on this execution. (**Save functionality is not yet implemented)
Main.py --batch 99999 --save --recurseCombine --input c:\some\input\folder --output c:\some\output\folder
With the root folder "c:\some\input\folder", this will load saved settings and skip confirmation of settings. It will also override saved settings for move, input, and quick. (**Save/Load functionality is not yet implemented)
Main.py --load --quick --move --input c:\some\input\folder