Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- printf "Usage: soundpost <image> <sound> \\n"
- image=$1
- sound=$2
- HOST="https://catbox.moe/user/api.php"
- link=$(curl -F "reqtype=fileupload" -F "fileToUpload=@$sound" $HOST)
- printf "%s" "Uploaded sound to: $link"
- printf "\\n"
- encode=$(echo "$link" | tail -c +9 | sed 's/:/%3A/g' | tr "/" "-" | sed "s/-/%2F/g")
- imagefilename=${image##*'/'}
- beforedot=${imagefilename%%'.'*}
- afterdot=${imagefilename##*'.'}
- final="${beforedot}[sound=$encode].$afterdot"
- # Add filename to clipboard
- printf "%s" "$final" | xclip -selection clipboard
- # Copy image with the appropriate filename
- printf "Copying image...\\n"
- cp "$image" "$final"
Add Comment
Please, Sign In to add comment