hi
i there an easier way to download coverart from youtube or extract from audio files to another folder while playing?
maybe someone know how to do that powershell thin in the panel script?
i am using this plugins...
https://github.com/marc2k3/foo_jscript_panel
https://fy.3dyd.com/download/
http://skipyrich.com/wiki/Foobar2000:Now_Playing_Simple
https://github.com/farpenoodle/FB2KNowPlayingOverlay
this is my panel script it triggers a powershell script which is placed in the root of FB2KNowPlayingOverlay
function on_playback_new_track(metadb) {
WSH = new ActiveXObject("WScript.Shell");
var path = fb.TitleFormat("%path%").Eval(true)
fb.Pause()
WSH.run("powershell.exe -ExecutionPolicy ByPass -f D:\\OBS\\plugins\\nowplaying0.1\\reader.ps1 \"" + path + "\"",0,true);
fb.play()
}
reader.ps1 powershell script
$ErrorActionPreference = 'SilentlyContinue'
Import-Module BitsTransfer
Push-Location $PSScriptRoot
if ($args.count -gt 0) {
remove-item "$PSScriptRoot\images\1.jpg" -force
$path = $args[0]
if ($path -like "*youtube*") {
$ytID = $path.split("=")[1]
$output = "$PSScriptRoot\images\1.jpg"
$checkURL = try {Invoke-WebRequest -Uri "https://img.youtube.com/vi/$ytID/maxresdefault.jpg" -Method 'HEAD'} catch {$false}
if ($checkURL) {
$url = "https://img.youtube.com/vi/$ytID/maxresdefault.jpg"
} else {
$url = "https://img.youtube.com/vi/$ytID/hqdefault.jpg"
}
Start-BitsTransfer -Source $url -Destination $output
} else {
.\ffmpeg.exe -hide_banner -loglevel panic -i $path -c:v copy "$PSScriptRoot\images\1.jpg" -y
}
}
Pop-Location
also tried this solution https://sometings.wordpress.com/2016/11/17/executing-powershell-encoded-within-a-vbscript/
but not tested much because jpanal crashed everytime :/
kind regards
beth