Atualizar src/m4binder.py
This commit is contained in:
+4
-4
@@ -164,7 +164,7 @@ def create_concat_list(file_paths, list_file):
|
||||
for path in file_paths:
|
||||
# For windows, escape backslashes in paths
|
||||
safe_path = path.replace("\\", "\\\\")
|
||||
# Escape any apostrophes for ffmpeg’s single-quoted syntax
|
||||
# Escape any apostrophes for ffmpeg's single-quoted syntax
|
||||
safe_path = safe_path.replace("'", "'\\''")
|
||||
f.write(f"file '{safe_path}'\n")
|
||||
|
||||
@@ -293,7 +293,7 @@ def get_book_metadata(args, mp3_files):
|
||||
1) If user wants metadata from Google/OpenLibrary, fetch it.
|
||||
2) Otherwise, extract from first MP3 (ID3 tags) or fallback to defaults.
|
||||
"""
|
||||
# If title/author are not provided, try to read from the first file’s ID3
|
||||
# If title/author are not provided, try to read from the first file's ID3
|
||||
if not args.title or not args.author:
|
||||
id3_tags = extract_id3_tags(mp3_files[0])
|
||||
default_title = id3_tags.get("album", "")
|
||||
@@ -336,7 +336,7 @@ def get_book_metadata(args, mp3_files):
|
||||
|
||||
def fetch_metadata_google_books(title=None, author=None, isbn=None, api_key=None):
|
||||
"""
|
||||
Very basic example. You’ll want to refine the search logic.
|
||||
Very basic example. You'll want to refine the search logic.
|
||||
"""
|
||||
print("[INFO] Fetching metadata from Google Books API...")
|
||||
# Build a query string
|
||||
@@ -377,7 +377,7 @@ def fetch_metadata_google_books(title=None, author=None, isbn=None, api_key=None
|
||||
def fetch_metadata_openlibrary(title=None, author=None, input_folder=None):
|
||||
"""
|
||||
Example stub using openlibrary-client (Requires pip install openlibrary-client).
|
||||
You’ll need to adapt this to your actual usage pattern:
|
||||
You'll need to adapt this to your actual usage pattern:
|
||||
e.g., searching by ISBN, or calling the .get() method, etc.
|
||||
"""
|
||||
if not OpenLibrary:
|
||||
|
||||
Reference in New Issue
Block a user