function findurl([string]$orgurl) {
$wc=New-Object System.Net.WebClient
$wc.Encoding = [System.Text.Encoding]::UTF8
$source=$wc.DownloadString($orgurl)
if ($source -match '(http://(.*?).yamvideo.com/[^"]+)"'){
return $Matches[1]
}
return "";
}

$url = Read-Host "URL?"
$streamurl = findurl($url)
if ($streamurl.Length -lt 1) { exit }
&.\ffmpeg -i $streamurl -c copy temp.mp4