Skip to main content

librofm

A Python client library for downloading audiobooks from Libro.fm.

Features

  • Download audiobooks from your Libro.fm library
  • Support for both MP3 and M4B formats (M4B preferred when available)
  • Automatic file organization by author and title
  • Command-line interface for batch downloads
  • Python API for programmatic access

Installation

pip install librofm

Configuration

Set your Libro.fm credentials as environment variables:

export LIBROFM_USERNAME="your_username"
export LIBROFM_PASSWORD="your_password"

Alternatively, create a .env file in your working directory:

LIBROFM_USERNAME=your_username
LIBROFM_PASSWORD=your_password

Usage

Command Line

Download all audiobooks to the default directory (~/Audiobooks):

librofm-download

Download to a custom directory:

librofm-download /path/to/audiobooks

By default, it won't overrite existing files. You can force it to redownload:

librofm-download --force

Show help:

librofm-download --help

Python API

from librofm.client import LibroFMClient

# Create client (uses environment variables)
client = LibroFMClient.get_client()

# Or create with explicit credentials
client = LibroFMClient("username", "password")

# Get your library
page = client.get_library()
print(f"Found {len(page.audiobooks)} audiobooks")

# Download a specific audiobook
audiobook = page.audiobooks[0]
success = client.download(audiobook, "/path/to/downloads")

# Get download manifest for MP3 files
manifest = client.get_download_manifest(audiobook)
print(f"Audiobook has {len(manifest.parts)} parts")

# Get M4B package info
m4b_info = client.get_packaged_m4b_info(audiobook)
if m4b_info:
    print(f"M4B available at: {m4b_info.m4b_url}")

File Organization

Downloaded audiobooks are organized as:

base_path/
\x00\x00 Author Name/
   \x00\x00 Book Title/
       \x00\x00 part1.mp3
       \x00\x00 part2.mp3
       \x00\x00 ...
\x00\x00 Another Author/
    \x00\x00 Another Book/
        \x00\x00 book.m4b

Requirements

  • Python 3.10+
  • Active Libro.fm account with audiobooks in your library

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Disclaimer

This tool is for personal use only. Please respect Libro.fm's terms of service and only download audiobooks you have legally purchased.

Release files for librofm 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for librofm 0.2.0
File Size Uploaded
librofm-0.2.0.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for librofm 0.2.0
File Interpreter ABI Platform
librofm-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size:14.8 kB

Release files / librofm-0.2.0.tar.gz

Download URL librofm-0.2.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
61be537aa46b5ed03ffcbda76616b56b39791d60d2ab178f6b1116f60ca57f55
BLAKE2b-256 checksum
How to use checksums
5a6d54599db6bf731bcc631d5d555a26b3958e40c6a527e3ef269bbcdb1d530c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.13.5 Linux/6.12.90+deb13-amd64

Release files / librofm-0.2.0-py3-none-any.whl

Download URL librofm-0.2.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45d16aa9cca5ba523f44d51becab72d1f5ba2a7a23e56b90ef352fd1f7b2395f
BLAKE2b-256 checksum
How to use checksums
6be8a2c8fb1c124c7b9d55bbdadead4b6c847d527ba63df31b5f675213bf6247
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.13.5 Linux/6.12.90+deb13-amd64

Release history Release notifications | RSS feed

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page