lil update
This commit is contained in:
parent
ce0de63636
commit
07a9178efe
|
@ -1,2 +1,4 @@
|
|||
$env:POWERSHELL_TELEMETRY_OPTOUT=yes
|
||||
Import-Module posh-git
|
||||
$env:POWERSHELL_TELEMETRY_OPTOUT="yes"
|
||||
|
||||
import-module ~/Documents/PowerShell/functions.psm1
|
||||
|
|
|
@ -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
|
||||
}
|
Loading…
Reference in New Issue