#!/bin/bash # Directory to save downloaded images OUTPUT_DIR="./downloads" mkdir -p "$OUTPUT_DIR" # Instagram Full Image Downloader # Usage: ./image-instagram-downloader.sh if [ $# -ne 1 ]; then echo "Usage: $0 " exit 1 fi URL="$1" # Fetch HTML content of the Instagram post HTML_DATA=$(curl -s "$URL") if [ -z "$HTML_DATA" ]; then echo "Could not fetch HTML data." exit 2 fi # Extract JSON data containing the full-resolution image URL JSON_DATA=$(echo "$HTML_DATA" | grep -oE '