From 5a8df51c97b008a2417402de8bd3e63176c63db3 Mon Sep 17 00:00:00 2001 From: sanj <67624670+iodrift@users.noreply.github.com> Date: Sun, 3 Nov 2024 12:57:01 -0800 Subject: [PATCH] Auto-update: Sun Nov 3 12:57:01 PST 2024 --- aax2mp3 | 61 +-------------------------------------------------------- camel | 4 ++-- 2 files changed, 3 insertions(+), 62 deletions(-) diff --git a/aax2mp3 b/aax2mp3 index b4dd043..1b2f97d 100755 --- a/aax2mp3 +++ b/aax2mp3 @@ -5,10 +5,6 @@ import subprocess import glob import os import multiprocessing -import re -import nltk -from nltk.corpus import words -from nltk.corpus import wordnet # Different ways to get CPU count logical_cores = os.cpu_count() # All cores including hyperthreading @@ -28,59 +24,6 @@ def convert_file(aax_file): print(f"Converting {aax_file} to {mp3_file}") subprocess.run(['ffmpeg', '-activation_bytes', os.getenv('AUDIBLE_ACTIVATION_BYTES'), '-i', aax_file, mp3_file], check=True) - return mp3_file - -def rename_file(mp3_file): - print(f"\n{'='*50}") - print(f"Original: {mp3_file}") - base, ext = os.path.splitext(mp3_file) - new_base = rename_base(base) - new_name = new_base + ext - print(f"New name: {new_name}") - - if new_name != mp3_file: - try: - os.rename(mp3_file, new_name) - print(f"Renamed: {mp3_file} -> {new_name}") - except OSError as e: - print(f"Error renaming {mp3_file}: {e}") - -def rename_base(base): - words = re.split('(?