greeple
Silver Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору $cUrl = Get-Clipboard $cDir = "$env:yd\MP3" $Template = "\%(uploader)s\%(title)s.%(ext)s" Write-Host "Available options (play with mpv by default):" Write-Host " du" -NoNewLine -ForegroundColor yellow Write-Host " - download torrents, copy with path" Write-Host " dv" -NoNewLine -ForegroundColor yellow Write-Host " - download video, best" Write-Host " da" -NoNewLine -ForegroundColor yellow Write-Host " - download audio, m4a or best" Write-Host " dc" -NoNewLine -ForegroundColor yellow Write-Host " - download, custom" $Choice = Read-Host -Prompt "Choose your option" Switch ($Choice) { "du" { .\aria2c.exe --file-allocation=none --conf-path=".\aria2c.conf" --dir=$cDir $cDir\$cUrl } "da" { $Choice3 = Read-Host -Prompt "Normalize audio with LoudNorm? (y), no by default" if ($Choice3 -eq "") { .\youtube-dl -f "bestaudio[ext=m4a]/bestaudio" --embed-thumbnail --add-metadata --ffmpeg-location "..\ffmpeg\bin" -o $cDir$Template $cUrl } Else { .\youtube-dl -f "bestaudio[ext=m4a]/bestaudio" --embed-thumbnail --add-metadata --ffmpeg-location "..\ffmpeg\bin" -o $cDir$Template $cUrl --exec "ffmpeg -loglevel quiet -stats -threads 0 -hide_banner -i {} -vn -threads 0 -af loudnorm=I=-14:TP=0.0:LRA=20:print_format=summary:linear=true -threads 0 -ar 48k {}.m4a" } } "dv" { .\youtube-dl -f "bestvideo+bestaudio[ext=m4a]/best" --merge-output-format mkv --ffmpeg-location "..\ffmpeg\bin" -o $cDir$Template $cUrl } "dc" { .\youtube-dl -F $cUrl $Choice2 = Read-Host -Prompt "Choose quality" if ($Choice2 -eq "") { $Choice2 = "bestvideo+bestaudio/best" } .\youtube-dl -f $Choice2 --ffmpeg-location "..\ffmpeg\bin" -o $cDir$Template --merge-output-format mkv $cUrl } Default { .\mpvnet --ytdl-format="bestvideo+bestaudio/best" $cUrl -cache 8192 } } if (-Not $?) { Read-Host -Prompt "Press 'Enter'..." } |