Skip to content

Instantly share code, notes, and snippets.

@krasi-georgiev
Last active May 12, 2025 12:00
Show Gist options
  • Save krasi-georgiev/afb8fce8d05dbe601545d514f080c095 to your computer and use it in GitHub Desktop.
Save krasi-georgiev/afb8fce8d05dbe601545d514f080c095 to your computer and use it in GitHub Desktop.
tldv.io download
#!/bin/bash
# Make sure the meeting is public to avoid needing authentication.
# Run directly with:
# bash <(curl -s https://gist.githubusercontent.com/krasi-georgiev/afb8fce8d05dbe601545d514f080c095/raw/tldv.sh)
# === Dependency check ===
for cmd in jq ffmpeg; do
if ! command -v $cmd >/dev/null 2>&1; then
echo "❌ Required command '$cmd' is not installed."
echo "πŸ‘‰ Install it with: brew install $cmd (on macOS) or apt install $cmd (on Linux)"
exit 1
fi
done
# === Prompt for Meeting ID ===
read -p "Paste the TLDV Meeting ID: " MEETING_ID
# === Fetch metadata ===
MEETING_JSON=$(curl -s "https://gw.tldv.io/v1/meetings/$MEETING_ID/watch-page?noTranscript=true")
# === Extract video URL safely ===
VIDEO_URL=$(echo "$MEETING_JSON" | jq -r '
if .meeting.video.source != null and .meeting.video.source != "null"
then .meeting.video.source
elif .video.source != null and .video.source != "null"
then .video.source
else empty
end
')
# === Check for error or missing video URL ===
if [[ -z "$VIDEO_URL" ]]; then
echo "❌ No video URL found. This meeting might not be public or returned invalid data."
echo -e "\nπŸ” Full API response:"
echo "--------------------------"
echo "$MEETING_JSON"
echo "--------------------------"
exit 1
fi
# === Set output filename ===
OUTPUT_FILE="${MEETING_ID}.mp4"
# === Download ===
echo "πŸŽ₯ Downloading from: $VIDEO_URL"
echo "πŸ’Ύ Saving as: $OUTPUT_FILE"
ffmpeg -i "$VIDEO_URL" -c copy "$OUTPUT_FILE"
echo "βœ… Download complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment