Hi there! Very interesting idea here. Unfortunately, it fails pretty early for
me:
The config file is saved at ~/.config/configstore/downloadstation-cli.json, but
the token is not generated at first.
if (!url || !username || !password || !token) {
return null;
}
And unfortunately, this block starting on line 16 of config-store.js prevents the token from being generated in
subsequent calls, even though line 22 of init.js would do this (if not for the
entirely null config object returned from config-store).
An other note - the trailing slash should be stripped from the url when saving
the config - otherwise the request urls will have a double slash. I fixed this
by manually editing the config file.
Re: the token issue - no matter - I tried to push through by getting my session ID out of the browser
cookie. With this set properly in the config, I still got either:
"ECONNREFUSED" if using my quickconnect URL
or
"Hostname/IP does not match certificate's altnames: IP: {REDACTED} is not in the cert's list:" if using the local IP address as the url.
These last two errors may be the fault of my personal settings, but I wasn't able to figure it out.
I was able to successfully get a list of Download Station tasks by copying entry.cgi the request as curl from the network tab of my browser. There I noted that the copied request uses v2 of the Download Station API, and this cli appears to use V1. That's probably not a problem, but I found it curious.