mirror of
https://github.com/Xevion/byte-me.git
synced 2025-12-05 23:14:31 -06:00
feat: seed script for testing data
This commit is contained in:
26
.data/seed.ps1
Normal file
26
.data/seed.ps1
Normal file
@@ -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."
|
||||||
Reference in New Issue
Block a user