forked from natto1784/dotfiles
massive rewrite using flake-parts
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
15
pkgs/customscripts/src/batspecup
Normal file
15
pkgs/customscripts/src/batspecup
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p sox ffmpeg curl jq
|
||||
mkdir spectrals
|
||||
cd spectrals
|
||||
for x in ../*$1
|
||||
do
|
||||
spec="$(echo $(ffprobe -loglevel error -show_entries format_tags=track -of default=noprint_wrappers=1:nokey=1 "$x") - $(ffprobe -loglevel error -show_entries format_tags=TITLE -of default=noprint_wrappers=1:nokey=1 "$x"))"
|
||||
sox "$x" -n spectrogram -o "$spec.png" -t "$spec"
|
||||
resp=$(curl -F file-upload=@"$spec.png" -F "api_key=$PTPIMGAPI" https://ptpimg.me/upload.php 2>/dev/null)
|
||||
echo "$spec"
|
||||
echo [img]https://ptpimg.me/$(echo $resp | jq -r .[0].code).$(echo $resp | jq -r .[0].ext)[/img]
|
||||
rm "$spec.png"
|
||||
done
|
||||
cd ..
|
||||
rm -r spectrals
|
||||
Reference in New Issue
Block a user