Skip to content

Instantly share code, notes, and snippets.

@rsmets
Last active February 4, 2023 03:18
Show Gist options
  • Save rsmets/bf3a561c6e2f180e15f5f932959d33f5 to your computer and use it in GitHub Desktop.
Save rsmets/bf3a561c6e2f180e15f5f932959d33f5 to your computer and use it in GitHub Desktop.
Found Audio How To Upload with Curl

While the website upload capabilites are being added...

You can still upload audio to Found Audio to be listed on the site by following these instructions.

Hit the /s3 path with the fileName, author and genre values populated. For example:

curl --location --request POST 'https://api.foundaudio.club/s3' \
--header 'Content-Type: application/json' \
--data-raw '{
    "fileName": "Come Inside",
    "author": "Roflz",
    "genre": "Deep House"
}'

The response body looks like:

{
    "url": "https://super-duper-test-tunes.s3.us-west-2.amazonaws.com/sets/Roflz/Cigs%20Inside?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAR2C3BBUEXTVZ6BXK%2F20230204%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20230204T025557Z&X-Amz-Expires=3600&X-Amz-Signature=55173dd05dffd04e14aa0c742a72eb709dff42d621214bcb556725f09282018f&X-Amz-SignedHeaders=host&x-amz-acl=public-read&x-id=PutObject"
}

You need to then take that url value for use in the next curl which allow includes the absolute path to the audio file you want to upload.

curl --location --request PUT 'https://super-duper-test-tunes.s3.us-west-2.amazonaws.com/sets/Roflz/Cigs%20Inside?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAR2C3BBUEXTVZ6BXK%2F20230204%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20230204T025557Z&X-Amz-Expires=3600&X-Amz-Signature=55173dd05dffd04e14aa0c742a72eb709dff42d621214bcb556725f09282018f&X-Amz-SignedHeaders=host&x-amz-acl=public-read&x-id=PutObject' \
--header 'Content-Type: audio/x-aiff' \
--data-binary '@/Users/cratedigger/mixes/Come Inside.aiff'

The upload time is dependant on file size and your bandwith. I have noticed on my network with ~5MB/s up it still takes 10 minutes for 400MB or 40MB/min.

Once complete, reach out to me via ray at jtlabs.xyz to let me know and I will gladly feature the mix on the site.

By uploading you certify that you own the rights to all audio in the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment