From edc6056ac19ed080d03da23b8b2b9f181a45b438 Mon Sep 17 00:00:00 2001 From: Xevion Date: Sun, 13 Jul 2025 12:45:38 -0500 Subject: [PATCH] feat: seed script for testing data --- .data/seed.ps1 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .data/seed.ps1 diff --git a/.data/seed.ps1 b/.data/seed.ps1 new file mode 100644 index 0000000..08c23ea --- /dev/null +++ b/.data/seed.ps1 @@ -0,0 +1,26 @@ +# Download all files from the Big Buck Bunny movies directory + +$baseUrl = "https://download.blender.org/peach/bigbuckbunny_movies/" +$outputDir = "$PSScriptRoot" + +# Get the HTML content of the directory listing +$html = Invoke-WebRequest -Uri $baseUrl + +# Extract all file links (ignore parent directory links) +$fileLinks = ($html.Links | Where-Object { + $_.href -notmatch '^\.\./' -and $_.href -notmatch '/$' + }).href + +# Download each file +foreach ($file in $fileLinks) { + $fileUrl = "$baseUrl$file" + $outFile = Join-Path $outputDir $file + if (Test-Path $outFile) { + Write-Host "Skipping $outFile (already exists)" + continue + } + Write-Host "Downloading $fileUrl to $outFile" + Invoke-WebRequest -Uri $fileUrl -OutFile $outFile +} + +Write-Host "All files downloaded."