Skip to content

Instantly share code, notes, and snippets.

@vmx
Last active November 20, 2023 21:53
Show Gist options
  • Save vmx/d451d47b4a3cc775b9e06e1d5c202be9 to your computer and use it in GitHub Desktop.
Save vmx/d451d47b4a3cc775b9e06e1d5c202be9 to your computer and use it in GitHub Desktop.
Download videos from Frame.io
#!/bin/sh
if [ "${#}" -eq 0 ]; then
echo "Usage: $(basename "${0}") frame.io-URL"
exit 1
fi
PAGE_URL=${1}
CURL_COMMAND=$(echo "${PAGE_URL}"|tr '/' ' '|awk '{ print "curl --silent -H x-review-link-id:" $4 " https://api.frame.io/v2/assets/" $5 }')
METADATA=$(${CURL_COMMAND})
VIDEO_URL=$(echo "${METADATA}"|jq -r '.h264_1080_best')
VIDEO_FILENAME=$(echo "${METADATA}"|jq -r '.name')
#!/bin/sh
if [ "${#}" -eq 0 ]; then
echo "Usage: $(basename "${0}") frame.io-URL"
exit 1
fi
PAGE_URL=${1}
echo "Page URL: ${PAGE_URL}"
CURL_COMMAND=$(echo "${PAGE_URL}"|tr '/' ' '|awk '{ print "curl --silent -H x-review-link-id:" $4 " https://api.frame.io/v2/assets/" $5 }')
echo "CURL command: ${CURL_COMMAND}"
METADATA=$(${CURL_COMMAND})
echo "Metadata: ${METADATA}"
VIDEO_URL=$(echo "${METADATA}"|jq -r '.hls_manifest')
echo "Video_URL: ${VIDEO_URL}"
VIDEO_FILENAME=$(echo "${METADATA}"|jq -r '.name')
echo "Video filename: ${VIDEO_FILENAME}"
youtube-dl --output "${VIDEO_FILENAME}" "${VIDEO_URL}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment