Nimbin[12]?Web & Tools / dvd / search.sh

dvd files

DVD collection database with IMDB lookup

c imdb movies cmake · oldest file 2026-10-05 · last change 2026-10-06 (3 days ago) · synced 3 days ago

C 92.7% Makefile 6.6%
wget https://git.christianimmanuel.de/web-tools/dvd/archive/dvd.tar.gz
search.sh 853 B · 28 lines raw
#!/bin/bash

# Function to search for DVD by barcode (UPC) using wget
search_dvd_by_barcode() {
    local barcode="$1"
    local api_url="https://api.upcitemdb.com/prod/trial/lookup?upc=$barcode"
    local api_key="your_upcitemdb_api_key"  # Replace with your UPCItemDB API key

    # Send request to UPCItemDB API and capture the response
    response=$(wget -qO- --header="Authorization: Bearer $api_key" "$api_url")

    # Parse the JSON response using jq to extract titles
    titles=$(echo "$response" | jq -r '.items[]?.title')

    if [[ -z "$titles" ]]; then
        echo "No results found for barcode $barcode."
    else
        echo "Titles found for barcode $barcode:"
        echo "$titles"
    fi
}

# Example usage:
barcode="0123456789012"  # Replace with actual barcode
while true; do
    read code
    search_dvd_by_barcode "$code"
done