>>108406833
>>108406762
>>108406654
metaflac ain't gonna work because it's not a tag, here's a cleaner version but you make sure you have mutagen installed because it pulls that in
"""Scrub a vendor string from a FLAC Vorbis Comment block."""
import re
import shutil
import sys
from mutagen.flac import FLAC
TARGET = "Monochrome"
def scrub_vendor(input_path: str, output_path: str, target: str = TARGET) -> bool:
shutil.copy2(input_path, output_path)
audio = FLAC(output_path)
if not audio.tags or not re.search(target, audio.tags.vendor, re.IGNORECASE):
print(f"'{target}' not found in vendor string.")
return False
audio.tags.vendor = re.sub(
target, "\x00" * len(target), audio.tags.vendor, flags=re.IGNORECASE
)
audio.save()
print(f"Scrubbed '{target}' from vendor string in: {output_path}")
return True
if __name__ == "__main__":
if len(sys.argv) != 3:
sys.exit("Usage: python scrub_flac_vendor.py input.flac output.flac")
scrub_vendor(sys.argv[1], sys.argv[2])