Greasy Fork is available in English.

Audible to MAM JSON Converter (Full API Version)

Complete API-based solution with full metadata cleaning, category mapping, and MAM search

Има други версии на този скрипт, където кодът е обновен. Покажи всички версии.

  • v2.1.3 12.02.2025

    Updated so if title is all caps it will fix it to capitalize the first letter of each word (this will capitalize small words like a, an and the, but its better than all caps imo)

  • v2.1.2 10.02.2025

    Quick fix to make it only search audiobooks on Audible.

  • v2.1.1 10.02.2025

  • 🔍 Search by Title only
  • 🔍 Search by Title + Author
  • Implemented API response caching system
  • Enhanced button container layout with vertical stacking
  • Added search query encoding for special characters
  • Improved error handling for search operations
  • Added visual feedback during search operations
  • Also added a constant to control whether search functionality is enabled or not (true for enabled and false for disabled).
  • v2.0.3 10.02.2025

    Audible to MAM Script Changelog - Subtitle Update

    🆕 New Feature

    Added subtitle support to title field:

    📝 What Changed

    • Updated the processApiData function to include subtitles
    • Modified title construction to follow "Main Title: Subtitle" format
    • Conditionally appends subtitle when present in API data

    🎯 Why This Matters

    • Matches Audible's display format for titles with subtitles
    • Provides more complete title information in MAM uploads
    • Maintains consistency with original audiobook metadata

    ⚙️ Implementation Notes

    • Uses template literals for clean string construction
    • Conditional check ensures compatibility with titles without subtitles
    • Maintains existing edition info handling while adding subtitle support

    📦 Affected Components

    • processApiData() function
    • Title construction logic
    • JSON output structure

  • v2.0.2 09.02.2025
    • Fixed paragraph spacing in descriptions
    • Improved HTML tag cleaning in descriptions
    • Added empty paragraph filtering
    • Enhanced text formatting consistency
  • v2.0.1 27.01.2025

    Tag System Improvements

    • Date Formatting
      • Changed from ISO format (YYYY-MM-DD) to full text (Month DD, YYYY)
      • Moved publication date to first position in tags
      • Updated "Audible Release" prefix to "Pub.:"
    • Duration Display
      • Enhanced runtime format (e.g., "5 hrs 30 mins" instead of "5h 30m")
      • Repositioned duration tag before publisher information
      • Improved spacing and readability
    • AI Tag Generation
      • Added intelligent tag generation for AI mode
      • Generates 3-4 contextual tags based on book content
      • Avoids generic genre terms
      • Uses existing ChatGPT infrastructure
    • Category Integration
      • Added category as tag for non-AI modes
      • Strips "Audiobooks - " prefix from category tags
      • Maintains consistent tag ordering

    Format Standardization

    • Tag Structure
      • Standardized separator formatting
      • Consistent capitalization patterns
      • Improved visual hierarchy
    • Conditional Tags
      • Enhanced edition info handling
      • Smarter tag filtering for empty values

    Code Optimization

    • New Functions
      • Added formatDate() for consistent date handling
      • Enhanced formatRuntime() for better duration display
      • Implemented generateAITags() for AI mode
    • Refactoring
      • Reorganized tag generation logic
      • Improved error handling for AI requests
      • Better null checking for optional fields

    Removed Features

    • Removed Audnex.us tag support (API limitation)
    • Eliminated redundant date formatting


    TL;DR: Quick update that focuses on improving tag readability and more AI integrations

  • v2.0.0 25.01.2025


    MAJOR UPDATE - 2.0.0 - API Migration & Major Improvements

    Core Architecture Changes

    • API Integration
      • Replaced DOM scraping with Audnex.us API
      • Eliminated page-layout dependency
      • Added ASIN extraction from URL
    • Performance
      • 70% faster execution
      • Removed 400+ lines of scraping code

    New Features

    • Floating Action Button
      • Modern UI with animations
      • Progress indicators
      • Disabled state during processing
    • Enhanced Error Handling
      • 10+ explicit error checks
      • Visual alerts for:
        • Missing ASIN
        • API failures
        • Invalid API keys

    Metadata Improvements

    • Name Cleaning
      • 45+ honorific patterns
      • 30+ academic suffixes
      • Military rank removal
    • Edition Detection
      • Unabridged/Special Edition variants
      • Numerical edition recognition

    Category System

    • Maintained 33 category mappings
    • Keyword scoring engine
    • GPT-4o-mini integration

    Bug Fixes

    • Fixed undefined editionInfo errors
    • Patched ASIN edge cases
    • Resolved clipboard issues

    Deprecated Features

    • Removed DOM scraping logic
    • Removed manual contributor detection
    • Removed page-specific CSS selectors

    Requirements

    • Script manager like Greasemonkey or Tampermonkey
    • Access to and upload privileges on MAM
    • Internet access to access Audible 😂
    • ChatGPT API key (optional)
  • v1.6.0 17.12.2024
    • Major Enhancement: Complete rewrite of cleanName function
      • Added extensive list of academic credentials:
        • Associate degrees (AA, AS, AAS, etc.)
        • Bachelor's degrees (BA, BS, BSN, BFA, etc.)
        • Master's degrees (MA, MS, MBA, MEd, etc.)
        • Doctoral degrees (PhD, MD, EdD, etc.)
        • International degree variants (MBBS, MBChB, etc.)
        • Certificates and diplomas
      • Enhanced nursing credential support:
        • Basic credentials (RN, LPN, LVN, CNA)
        • Advanced practice certifications (APRN, NP, CNS, etc.)
        • Specialty certifications (CEN, CCRN, TCRN, etc.)
        • Board certifications (RNC, RNC-OB, RNC-NIC, etc.)
        • Education and leadership credentials (CNE, CNEA, NEA-BC)
      • Improved pattern matching:
        • Better handling of hyphenated credentials
        • Support for various bracketed formats (parentheses, square brackets, curly braces)
        • Enhanced detection of professional roles and titles
        • Improved cleaning of compound credentials
      • Added international and cultural title support:
        • Common international titles (Dato, Datuk, etc.)
        • Cultural variations of professional titles
        • International certification formats
    • Technical Improvements
      • Optimized regex patterns for better performance
      • Improved handling of separators and whitespace
      • Better cleanup of partial matches
      • Enhanced duplicate prevention
    • Bug Fixes
      • Fixed incomplete removal of compound credentials
      • Corrected handling of periods in credentials
      • Improved treatment of hyphenated names
      • Better handling of edge cases with multiple credentials

    Note: This update significantly improves the handling of author and narrator names with various credentials, titles, and certifications. The function now properly cleans names regardless of their role (author or narrator) and handles a much broader range of academic and professional credentials.

  • v1.5.2 16.12.2024

    Missed that the api is gpt-4o-mini

  • v1.5.1 16.12.2024

    Woops, backwards. Was supposed to be updating from GPT-4 to GPT-4o mini but went the other way around :)

  • v1.5.0 16.12.2024

    Major Changes

    • Removed all AI model options except ChatGPT for simplification and improved reliability
    • Fixed edition detection in titles to properly handle formats like "Title: X Edition" It should move these to the tags but this is not working with all books so double check
    • Updated GPT model from "gpt-4o-mini" to "gpt-4" for cheaper usage

    Code Cleanup

    • Removed unused AI model constants and configurations (please let me know if you use any of these on MAM and I'll work on readding them. I figured there was no point supporting all of them if no one used them):
      • Removed Meta Llama integration
      • Removed Google Gemini integration
      • Removed Mistral AI integration
      • Removed Anthropic Claude integration
    • Simplified AI-related configuration options:
      • Removed AI_MODEL constant since ChatGPT is the only one
      • Kept only CHATGPT_API_KEY for configuration
    • Updated function names to be ChatGPT-specific:
      • Renamed detectSeriesFromAI to detectSeriesWithChatGPT
      • Consolidated all AI calls to use ChatGPT endpoints

    UI Updates

    • Updated button text to specifically reference ChatGPT instead of generic AI
    • Simplified processing overlay to reflect ChatGPT-only functionality

    Bug Fixes

    • Fixed edition detection logic to properly handle titles with editions after colons
    • Improved title cleaning for better metadata accuracy
    • Updated regular expressions for more reliable edition extraction
    • Fixed the honorifics removal to also remove if there was not a period after the honorific (for instance it will now remove Dr and Dr. in Dr Jones)
    • Added a few more honorifics that I ran across in Audible
  • v1.4.2 19.10.2024

    Added "ScD" and "DrPH" to titles to remove.

  • v1.4.1 13.10.2024
    • Updated: Improved the cleanName function to more effectively remove titles and credentials from author and narrator names.
    • Added: "MS" (Master of Science) and "MN" (Master of Nursing) to the list of titles to be removed.
    • Fixed: Bug where certain titles (like "RN") were not being removed from the middle of names.
    • Enhanced: Name cleaning process now removes titles from the beginning, middle, and end of names.
    • Improved: Better handling of spaces after title removal to prevent extra spaces in cleaned names.

    This update focuses on improving the accuracy of author and narrator name cleaning, ensuring a more consistent and clean output in the generated JSON metadata.

  • v1.4.0 05.10.2024
    • Added an overlay with a loading message when processing JSON data
    • Implemented a blurred background effect for the overlay
    • Included an AI processing GIF in the overlay when an AI model is selected
    • Made the button text dynamic:
      • "Copy Book info to JSON with AI" when an AI model is selected
      • "Copy Book info to JSON without AI" when no AI model is used
  • v1.2.0 05.10.2024
    • Added support for multiple AI models for category selection (if you are going to do this, I would recommend Chatgpt 4o mini since that is the cheapest by far:
      • ChatGPT (OpenAI)
      • Meta Llama
      • Google Gemini (128K and 1M versions)
      • Mistral AI
      • Anthropic Claude 3
    • Introduced AI_MODEL constant for selecting the preferred AI service
    • Added API key constants for each AI service
    • Implemented individual functions for each AI service API call
    • Updated getMAMCategory function to use the new AI selection process
  • v1.1.0 04.10.2024
    • Implemented smart category matching to improve accuracy in audiobook choices:
      • Added AUDIBLE_TO_MAM_CATEGORY_MAP for direct category mapping
      • Added KEYWORD_TO_MAM_CATEGORY_MAP for keyword-based category matching
      • Created smartCategoryMatcher function to determine the best MAM category based on Audible category, title, and description
      • Updated getMAMCategory function to use the new smart matching system
    • Improved author extraction:
      • Updated getAuthors function to filter out bogus entries like "Title" and "Author + Title"
      • Enhanced cleaning of author names by removing additional titles and honorifics
    • Enhanced narrator extraction:
      • Updated getNarrators function to exclude "Full Cast" from the list of narrators
      • Improved cleaning of narrator names
  • v1.0.6 04.10.2024
  • v1.0.6 04.10.2024
    • Updated getNarrators() function to exclude "Full Cast" from the list of narrators
    • Added BSN, MSN, and RN to the list of titles removed from both author and narrator names
  • v1.0.5 04.10.2024
    • Implemented new getAuthors() function to improve author detection and filtering:
      • Now uses data-authorid attribute to identify genuine author links
      • Prevents duplicate author entries
      • Filters out non-author entries (e.g., "Prologue Projects")
    • Created similar getNarrators() function for improved narrator detection
    • Updated both author and narrator processing to use textContent.trim() instead of innerHTML for better text extraction
    • Modified generateJson() function to use the new getAuthors() and getNarrators() functions
    • These changes should prevent incorrect entries like "Title" and "Author + Title" from appearing in the authors list
  • v1.0.4 04.10.2024
  • v1.0.4 04.10.2024
    1.0.4
    • Added ASIN extraction and included it in the JSON output with "ASIN:" prefix.
    • Updated button styling and placement to match Audible's interface and how Dr.Blank's script was.
    • Enhanced metadata cleaning for authors, narrators, and series names.
    • Improved subtitle handling to avoid series name conflicts.
    • Extended support for all Audible top-level domains.
  • v1.0.3 04.10.2024

    Version History

    1.0.3
    • Added a comprehensive version history section on the Greasyfork script page.
    • Implemented a properly formatted HTML description for improved readability and user understanding.
    1.0.2
    • Restored functionality to open the MyAnonaMouse (MAM) upload page after metadata extraction, aligning with Dr.Blank's original version.
    • Implemented cleaning functions to remove information from names, narrators, and authors that are not permitted on MAM, enhancing compatibility with the platform's requirements.
    1.0.1
    • Fixed an issue where the audiobook description was not being formatted correctly during extraction.
    1.0.0
    • Initial rewrite of Dr.Blank's version.
    • Added support for Audible pages with banners, expanding the script's functionality to more page layouts.
  • v1.0.2 04.10.2024
  • v1.0.2 04.10.2024