mirror of https://github.com/captn3m0/Scripts.git
parent
6632edd96c
commit
99ddefeb6b
|
@ -110,3 +110,4 @@ This lives in my `~/projects/scripts` directory and is added to my `$PATH`. Not
|
|||
| ec | script to edit common configuration |
|
||||
| get-nav | Get NAV of a mutual fund from the Kuvera API |
|
||||
| audiobook2video | Generates a video for a music file, with a background |
|
||||
| fix-audible-m4a | Third-party. Fixes audible m4a fiels with incorrect Audio Object Type Specific Config bit. Source: https://rentry.co/n4ost |
|
|
@ -4,3 +4,4 @@ IFS=$'\n\t'
|
|||
|
||||
# PODMAN FTW!
|
||||
podman run -v $(pwd):/data ryanfb/inaudible@sha256:b66738d235be1007797e3a0a0ead115fa227e81e2ab5b7befb97d43f7712fac5
|
||||
for i in "*.m4a"; do fix-audible-m4a "$i";done
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash
|
||||
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
|
||||
set -euo pipefail
|
||||
|
||||
# Source: https://rentry.co/n4ost
|
||||
|
||||
f="$1"
|
||||
t=$(mktemp)
|
||||
mp4extract-bento4 moov/trak/mdia/minf/stbl/stsd/mp4a/esds \
|
||||
"$f" /dev/stdout | xxd -p | tr -d '\n' > $t
|
||||
|
||||
magic=$(sed -re 's/^.*0580808002(....).*$/\1/' $t)
|
||||
|
||||
if [ "$magic" != "1212" ]; then
|
||||
echo "no need to fix"
|
||||
rm "$t"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
t2=`mktemp`
|
||||
new=$(sed -re 's/05808080021212/05808080021210/' $t | xxd -r -p >$t2)
|
||||
rm $t
|
||||
old="${f}.pre-fix"
|
||||
mv -v "$f" "$old"
|
||||
mp4edit --replace \
|
||||
moov/trak/mdia/minf/stbl/stsd/mp4a/esds:"$t2" \
|
||||
"$old" \
|
||||
"$f"
|
||||
|
||||
rm "$old"
|
Loading…
Reference in New Issue