Not sure, maybe. You can send me the script to reproduce this so I'll be able to check what happens in the component.
Ok, paste this script in WSH panel:
(Script will update genre tag from Last.fm).
// ==PREPROCESSOR==
// @name "Auto Tag"
// @author "Mire777"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==
//Properties
var api_key = window.GetProperty("Last.fm Api", "f21088bf9097b49ad4e7f487abab981e");
var AutoTag = window.GetProperty("Tag Auto", "1");
var Overwrite = window.GetProperty("Tag Overwrite", "0");
var objXMLHTTP = new ActiveXObject("MSXML2.XMLHTTP");
var top_tags_values;
var UpdateTags;
var text = "";
function on_playback_time (time) {
metadb = fb.GetNowPlaying();
if (!metadb) {return;}
if(AutoTag==1 && time==1)
{
top_tags_values=""; getTags();
}}
function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}
ButtonStates = {
normal: 0,
hover: 1,
down: 2,
hide: 3
}
var DT_TOP = 0x00000000;
var DT_CENTER = 0x00000001;
var DT_VCENTER = 0x00000004;
var DT_WORDBREAK = 0x00000010;
var DT_CALCRECT = 0x00000400;
var DT_NOPREFIX = 0x00000800;
var g_theme = window.CreateThemeManager("Button");
var g_font = gdi.Font("Tahoma",11);
function SimpleButton(x, y, w, h, text, fonClick, state) {
this.state = state ? state : ButtonStates.normal;
this.x = x;
this.y = y;
this.w = w;
this.h = h;
this.text = text;
this.fonClick = fonClick;
this.containXY = function(x, y) {
return (this.x <= x) && (x <= this.x + this.w) && (this.y <= y) && (y <= this.y + this.h);
}
this.changeState = function(state) {
var old = this.state;
this.state = state;
return old;
}
this.draw = function(gr) {
if (this.state == ButtonStates.hide) return;
switch (this.state) {
case ButtonStates.normal:
g_theme.SetPartAndStateId(1, 1);
break;
case ButtonStates.hover:
g_theme.SetPartAndStateId(1, 1);
break;
case ButtonStates.down:
g_theme.SetPartAndStateId(1, 3);
break;
case ButtonStates.hide:
return;
}
g_theme.DrawThemeBackground(gr, this.x, this.y, this.w, this.h);
gr.GdiDrawText(this.text, g_font, RGB(0, 0, 0), this.x, this.y, this.w, this.h, DT_WORDBREAK | DT_CENTER | DT_VCENTER | DT_CALCRECT | DT_NOPREFIX);
}
this.onClick = function() {
this.fonClick && this.fonClick();
}
}
function drawAllButtons(gr) {
for (var i in $buttons) {
$buttons[i].draw(gr);
}
}
function chooseButton(x, y) {
for (var i in $buttons) {
if ($buttons[i].containXY(x, y) && $buttons[i].state != ButtonStates.hide) return $buttons[i];
}
return null;
}
$buttons = {
FindTags: new SimpleButton(0, 0, (window.Height) - (window.Height)+27, (window.Height) - (window.Height)+22, "Tag", function() {
rbtn_up(24, 17);
}),
}
var cur_btn = null;
var g_down = false;
function on_size() {
ww = window.Width;
wh = window.Height;
window.Repaint();
}
function on_paint(gr) {
this.dui = window.InstanceType;
if (this.dui) {
col = window.GetColorDUI(1);
gr.FillSolidRect(0, 0, ww, wh, col);
}
else
{
col = window.GetColorCUI(3);
}
myfont = gdi.Font("Segoe UI", 12, 0)
gr.FillSolidRect(0, 0, window.Width, window.Height, col);
gr.GdiDrawText(text, myfont, col, 0, 40, window.Width, window.Height, DT_WORDBREAK | DT_CALCRECT | DT_NOPREFIX);
drawAllButtons(gr);
}
function on_mouse_move(x, y) {
var old = cur_btn;
cur_btn = chooseButton(x, y);
if (old == cur_btn) {
if (g_down) return;
} else if (g_down && cur_btn && cur_btn.state != ButtonStates.down) {
cur_btn.changeState(ButtonStates.down);
window.Repaint();
return;
}
old && old.changeState(ButtonStates.normal);
cur_btn && cur_btn.changeState(ButtonStates.hover);
window.Repaint();
}
function on_mouse_leave() {
g_down = false;
if (cur_btn) {
cur_btn.changeState(ButtonStates.normal);
window.Repaint();
}
}
function on_mouse_lbtn_down(x, y) {
g_down = true;
if (cur_btn) {
cur_btn.changeState(ButtonStates.down);
window.Repaint();
}
}
function on_mouse_lbtn_up(x, y) {
g_down = false;
if (cur_btn) {
cur_btn.onClick();
cur_btn.changeState(ButtonStates.hover);
window.Repaint();
}
}
//Menu
this.rbtn_up = function(x, y) {
var _menu = window.CreatePopupMenu();
var q = window.CreatePopupMenu();
var MF_GRAYED = 0x00000001;
var MF_STRING = 0x00000000;
var MF_SEPARATOR = 0x00000800;
var MF_POPUP = 0x00000010;
var idx;
if(AutoTag==1) _menu.AppendMenuItem(MF_STRING, 1, "Auto Tag");
if(AutoTag==0) _menu.AppendMenuItem(MF_STRING, 2, "Auto Tag");
_menu.CheckMenuItem(1, AutoTag?1:0);
_menu.AppendMenuSeparator();
if(Overwrite==1) _menu.AppendMenuItem(MF_STRING, 3, "Overwrite");
if(Overwrite==0) _menu.AppendMenuItem(MF_STRING, 4, "Overwrite");
_menu.CheckMenuRadioItem(3, 4, 4-1);
_menu.AppendMenuSeparator();
_menu.AppendMenuItem(MF_STRING, 5, "Get Tags...");
_menu.AppendMenuSeparator();
_menu.AppendMenuItem(MF_STRING, 6, "Properties...");
if (utils.IsKeyPressed(0x10)) _menu.AppendMenuItem(MF_STRING, 7, "Configure...");
idx = _menu.TrackPopupMenu(x, y);
switch(idx) {
case 1:
AutoTag = 0;
window.SetProperty("Tag Auto", "0");
break;
case 2:
AutoTag = 1;
window.SetProperty("Tag Auto", "1");
break;
case 3:
Overwrite = 0;
window.SetProperty("Tag Overwrite", "0");
break;
case 4:
Overwrite = 1;
window.SetProperty("Tag Overwrite", "1");
break;
case 5:
UpdateTags = 1;
getTags();
break;
case 6:
window.ShowProperties();
break;
case 7:
window.ShowConfigure();
break;
}
_menu.Dispose();
}
function getTags() {
if (objXMLHTTP != null) {
{
metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
if (!metadb) {return;}
genre = fb.TitleFormat("%Genre%").EvalWithMetadb(metadb);
artist = fb.TitleFormat("%artist%").EvalWithMetadb(metadb);
title = fb.TitleFormat("%title%").EvalWithMetadb(metadb);
file = fb.TitleFormat("%path%").EvalWithMetadb(metadb);
{if (Overwrite==0 && genre>"?" && !UpdateTags) return;}
if (artist == "" || artist == "?" || title == "" || title == "?") return;
url = "https://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=" + api_key + "&artist=" + encodeURIComponent(artist) + "&track=" + encodeURIComponent(title) + "&format=json";
try {
objXMLHTTP.open("GET", url, false);
objXMLHTTP.setRequestHeader('User-Agent', "foobar2000_script");
objXMLHTTP.send("");
urlreadyState = (objXMLHTTP.readyState);
urlstatus = (objXMLHTTP.status);
if (urlreadyState == "4" && urlstatus == "200") {
data = objXMLHTTP.ResponseText;
objXMLHTTP.Close;
}
json_data = JSON.parse(data);
artist_name = json_data.track.artist.name;
title_name = json_data.track.name;
top_tags = json_data.track.toptags.tag;
top_tags_values = [];
items = top_tags.length;
if (top_tags.length > 0) {
for (i = 0; i < items; i++) {
name = json_data.track.toptags.tag[i].name.replace(/&/g, " \& ");
top_tags_values.push(name);
}
}
fb.trace("Tags:" + top_tags_values);
objXMLHTTP.Close;
} catch (err) {
objXMLHTTP.Close;
}
if (top_tags_values>"")
{
tags = top_tags_values.toString();
tags = tags.replace(/,/g, "/");
metadb.UpdateFileInfoSimple("GENRE", tags);
window.Repaint();
UpdateTags = "";
}
else {getTags2();}
}}}
function getTags2() {
if (objXMLHTTP != null) {
{
metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
if (!metadb) {return;}
genre = fb.TitleFormat("%Genre%").EvalWithMetadb(metadb);
artist = fb.TitleFormat("%artist%").EvalWithMetadb(metadb);
title = fb.TitleFormat("%title%").EvalWithMetadb(metadb);
file = fb.TitleFormat("%path%").EvalWithMetadb(metadb);
{if (Overwrite==0 && genre>"?" && !UpdateTags) return;}
if (artist == "" || artist == "?" || title == "" || title == "?") return;
url = "https://ws.audioscrobbler.com/2.0/?method=artist.getTopTags&api_key=" + api_key + "&artist=" + encodeURIComponent(artist) + "&format=json";
try {
objXMLHTTP.open("GET", url, false);
objXMLHTTP.setRequestHeader('User-Agent', "foobar2000_script");
objXMLHTTP.send("");
urlreadyState = (objXMLHTTP.readyState);
urlstatus = (objXMLHTTP.status);
if (urlreadyState == "4" && urlstatus == "200") {
data = objXMLHTTP.ResponseText;
objXMLHTTP.Close;
}
json_data = JSON.parse(data);
top_tags = json_data.toptags.tag;
top_tags_values = [];
if (top_tags.length > 0) {
var lng;
if (top_tags.length>5) {lng = 5;}
if (top_tags.length<5) {lng = top_tags.length;}
for (i = 0; i < lng; i++) {
name = json_data.toptags.tag[i].name.replace(/&/g, " \& ");
top_tags_values.push(name);
}
}
fb.trace("Tags:" + top_tags_values);
objXMLHTTP.Close;
} catch (err) {
objXMLHTTP.Close;
}
if (top_tags_values>"")
{
tags = top_tags_values.toString();
tags = tags.replace(/,/g, "/");
metadb.UpdateFileInfoSimple("GENRE", tags);
window.Repaint();
UpdateTags = "";
}
}}}
function on_playback_stop() {
tags = "";
window.Repaint();
}
function on_mouse_rbtn_up(x, y) {
return true;
}
Try this url: www.youtube.com/watch?fb2k_title=All%20I%20Need&3dydfy_alt_length=217&fb2k_artist=Koffee%20Brown&v=87H4sBbik6s
For me it stops after 10 sec.