revamp regulation youtube scripts, start revamp of patreon

This commit is contained in:
2026-04-26 15:31:30 -05:00
parent 9d6d02b751
commit 18d5913d5e
4 changed files with 816 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
function Download-YTDLP {
Param(
[Parameter(Mandatory=$true)]
[string]$videoUrl,
[Parameter(Mandatory=$true)]
[string]$OutputPath,
[string]$RejectString,
[switch]$WithCookies
)
$ytDlpPath = "D:\yt-dlp\yt-dlp.exe"
# Start building an array of arguments using strict comma separation (Recommended format)
$arguments = @(
$videoUrl,
"--write-info-json",
"--write-thumbnail",
"--convert-thumbnails", "jpg",
"--no-progress",
"-t", "sleep",
"--rate-limit", "5M",
"-o", $OutputPath,
'-f', "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best",
"-S", "vcodec:h264",
"--reject-title", $RejectString,
"--playlist-reverse"
)
# --- Conditional Logic Applied Here ---
if ($WithCookies) {
Write-Verbose "--- Using browser cookies for download. ---" -Verbose
$arguments += "--cookies-from-browser", "firefox" # Added comma here too
} else {
Write-Verbose "--- Downloading without specific cookie credentials. ---" -Verbose
}
# Execute yt-dlp using the call operator (&) and passing the arguments array (@)
& $ytDlpPath $arguments
}
# Example Usage:
# Download-Video -videoUrl "URL_HERE" -OutputPath "./output" -WithCookies