lil update

This commit is contained in:
leah 2022-10-18 22:12:03 +01:00
parent ce0de63636
commit 07a9178efe
2 changed files with 28 additions and 4 deletions

View File

@ -1,2 +1,4 @@
$env:POWERSHELL_TELEMETRY_OPTOUT=yes
Import-Module posh-git
$env:POWERSHELL_TELEMETRY_OPTOUT="yes"
import-module ~/Documents/PowerShell/functions.psm1

View File

@ -1,12 +1,34 @@
function Save-VideoAsMp3
{
function Save-VideoAsMp3 {
[CmdletBinding()]
[alias("2mp3")]
param(
[Parameter(Mandatory=$true)]
[Parameter(Mandatory = $true)]
[String]$Url
)
Push-Location ~/Music
yt-dlp.exe --throttled-rate=40K -N4 --extract-audio --audio-format mp3 $Url
Pop-Location
}
function Publish-File {
[CmdletBinding()]
[alias("ttmsh")]
param(
[Parameter(Mandatory = $true)]
[String]$File
)
$RequestDetails = @{
Uri = 'https://ttm.sh'
SessionVariable = 'Session'
Method = 'POST'
Form = @{
file = Get-Item -Path $File
}
}
$Response = Invoke-WebRequest @RequestDetails
$Response.Content
}