Skip to main content

aac Repair

repair aac and aacPlus files grabbed from the internet

Info

Aac files consist of multiple segments, frames. Each frame has a header and payload. Browser get stuck if aac file frame is defective and will not start to play or refuse to play next aac file. This will stop the entire playlist. File gets trimmed from head to tail, to remove defective frames. Cut off byte count is shown in the summary (aac_repair.txt).

Usage

from aacrepair import AacRepair

# 'r' before a string tells the Python interpreter to treat backslashes as a literal (raw) character
aacRepair = AacRepair(r"F:\propaganda-podcasts")
aacRepair.repair()

Instantiate AacRepair class with two possible arguments, mandatory folder path and optional dictionary.

  1. No dictionary provided. Folder path is used as list to import files into a dictionary AND store repaired files.
  2. A dictionary of files is provided. Folder path is used to store repaired files. (best use on web server)

Web Server

  • endpoint converts uploaded files from file storage type to bytestream, use .read() function

    • web server gets not the file path, only file name - needs path to store repaired files
    • dictionary {file(n).aac: b'\x65\x66\x67\x00\x10\x00\x00\x00\x04\x00'}

    files = request.files.getlist('fileUploadAcpRepair') f_dict = {f.filename: f.read() if f.filename[-5:] == ".aacp" or f.filename[-4:] == ".aac" else None for f in files} aacRepair = AacRepair("/home/Kitty/aac_files", f_dict) aacRepair.repair()

File System

  • List of files in folder is written to dictionary {file_name_key: file_byte_content_value}

    aacRepair = AacRepair("/home/Kitty/aac_files") aacRepair.repair()

package deploy class init.py

# expose the class
from aac_repair import AacRepair

pip install

""" xxs Linux xxs """
$ pip3 install aacrepair

""" xxm Windows xxm """
> pip install aacrepair

Uninstall

Python user:

  • find the module location
  • uninstall and then remove remnants

$ pip3 show aacrepair

$ pip3 uninstall aacrepair

Location: ... /python310/site-packages

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aacRepair-0.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aacRepair-0.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file aacRepair-0.1.tar.gz.

File metadata

  • Download URL: aacRepair-0.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.3

File hashes

Hashes for aacRepair-0.1.tar.gz
Algorithm Hash digest
SHA256 39f3b6309da469c2e5de9b8520205d6aa739b19713bfd465df96245c59b9f378
MD5 30bfed00c53d1caa91bcb5c12373dec9
BLAKE2b-256 19683ae567e6fb36010f7d99b03fe2310a7a184c1f78f60b04e4e8daaf52d58b

See more details on using hashes here.

File details

Details for the file aacRepair-0.1-py3-none-any.whl.

File metadata

  • Download URL: aacRepair-0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.3

File hashes

Hashes for aacRepair-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d836da7e768f731f4ec10b3dd734d477ad9262a704feb295cd9102c7d1c4ee68
MD5 0a2f9f6c9de37ea2eaa4eb75d15b3c87
BLAKE2b-256 cf032c1d336510698c9613901f502f987a62a09b4c0f89bdf7252cd910d28f5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page