Guest User

soundpost

a guest
Jul 14th, 2024
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. printf "Usage: soundpost <image> <sound> \\n"
  4.  
  5. image=$1
  6. sound=$2
  7. HOST="https://catbox.moe/user/api.php"
  8. link=$(curl -F "reqtype=fileupload" -F "fileToUpload=@$sound" $HOST)
  9.  
  10. printf "%s" "Uploaded sound to: $link"
  11. printf "\\n"
  12.  
  13. encode=$(echo "$link" | tail -c +9 | sed 's/:/%3A/g' | tr "/" "-" | sed "s/-/%2F/g")
  14. imagefilename=${image##*'/'}
  15. beforedot=${imagefilename%%'.'*}
  16. afterdot=${imagefilename##*'.'}
  17. final="${beforedot}[sound=$encode].$afterdot"
  18.  
  19. # Add filename to clipboard
  20. printf "%s" "$final" | xclip -selection clipboard
  21.  
  22. # Copy image with the appropriate filename
  23. printf "Copying image...\\n"
  24. cp "$image" "$final"
Add Comment
Please, Sign In to add comment