Ill try it out but a bit unsure how that helps for example, this is my JS script to connect to the MM:
Code: Select all
async function getWebSocketDebuggerUrl() {
try {
// Fetch the list of open pages from the browser
const response = await axios.get('http://localhost:9222/json');
const pages = response.data;
// Find the page with the URL 'file:///mainwindow.html'
const mainPage = pages.find(page => page.url === 'file:///mainwindow.html');
if (mainPage) {
// Return the WebSocket debugger URL
return mainPage.webSocketDebuggerUrl;
} else {
throw new Error("Main window page not found.");
}
} catch (error) {
console.error('Error fetching WebSocket debugger URL:', error);
}
}
var wsUrl = await getWebSocketDebuggerUrl();
console.log(wsUrl);
var ws = new WebSocket(wsUrl);
//Further script to send commands on open close error etc
similarly here's the python script to achieve the same:
Code: Select all
import win32com.client
# Create a COM object for MediaMonkey
SDB = win32com.client.Dispatch("SongsDB5.SDBApplication")
In both these scripts there is no field to connect to a particular MM server via IP/Port or server name. So even if I have multiple servers with different names and IPs in unable to connect to that server specifically. Hence I wanted to know if theres any way to communicate and send commands to a MM server specifically.
Also to clarify, the problem is not setting up multiple servers/access points in MM but to communicate with them from an external application.
Ill try it out but a bit unsure how that helps for example, this is my JS script to connect to the MM:
[code]
async function getWebSocketDebuggerUrl() {
try {
// Fetch the list of open pages from the browser
const response = await axios.get('http://localhost:9222/json');
const pages = response.data;
// Find the page with the URL 'file:///mainwindow.html'
const mainPage = pages.find(page => page.url === 'file:///mainwindow.html');
if (mainPage) {
// Return the WebSocket debugger URL
return mainPage.webSocketDebuggerUrl;
} else {
throw new Error("Main window page not found.");
}
} catch (error) {
console.error('Error fetching WebSocket debugger URL:', error);
}
}
var wsUrl = await getWebSocketDebuggerUrl();
console.log(wsUrl);
var ws = new WebSocket(wsUrl);
//Further script to send commands on open close error etc
[/code]
similarly here's the python script to achieve the same:
[code]
import win32com.client
# Create a COM object for MediaMonkey
SDB = win32com.client.Dispatch("SongsDB5.SDBApplication")
[/code]
In both these scripts there is no field to connect to a particular MM server via IP/Port or server name. So even if I have multiple servers with different names and IPs in unable to connect to that server specifically. Hence I wanted to know if theres any way to communicate and send commands to a MM server specifically.
Also to clarify, the problem is not setting up multiple servers/access points in MM but to communicate with them from an external application.