Credentials error: Wrong or expired sessionid
did the code still working?
im trying some example there but showing error
"Credentials error: Wrong or expired sessionid"
im have to put correct token id, but still get the error. anyone can help to solve it?
im try using this code
const TradingView = require("@mathieuc/tradingview");
if (!process.argv[2]) throw Error('Please specify your 'sessionid' cookie');
const client = new TradingView.Client({ token: process.argv[2], });
const chart = new client.Session.Chart(); chart.setMarket('BINANCE:BTCEUR', { timeframe: 'D', });
TradingView.getPrivateIndicators(process.argv[2]).then((indicList) => { indicList.forEach(async (indic) => { const privateIndic = await indic.get(); console.log('Loading indicator', indic.name, '...');
const indicator = new chart.Study(privateIndic);
indicator.onReady(() => {
console.log('Indicator', indic.name, 'loaded !');
});
indicator.onUpdate(() => {
console.log('Plot values', indicator.periods);
console.log('Strategy report', indicator.strategyReport);
});
}); });
output :
$ node indicatorTest.js
The same problem
It seems that we also need to include the sessionid_sign.
Same issue here. Seems like TradingView has made a breaking change.
temporary, if you include "sessionid=${session};sessionid_sign={YOUR_VALUE};" in miscRequests.js line 408 should work.
temporary, if you include "sessionid=${session};sessionid_sign={YOUR_VALUE};" in miscRequests.js line 408 should work.
+1. It works.
temporary, if you include "sessionid=${session};sessionid_sign={YOUR_VALUE};" in miscRequests.js line 408 should work.
Thanks its, worked now..
Also, username/password based login still works well. At least with the most recent version via github
"dependencies": {
"@mathieuc/tradingview": "github:Mathieu2301/TradingView-API",
}
Simply run await TradingView.loginUser(...) and then use the client without passing any arguments.
How can I use your method without it disconnecting my browser TradingView? @kyr0
I still get the same error with this code.. @0xR-Dev @hawooni
sign = "v1:j6C5uAzIpQcAfHIUMhyFESRrKWCeO/fv/mt+4qRRPsE="
async getUser(session, location = 'https://www.tradingview.com/') {
return new Promise((cb, err) => {
https.get(location, {
headers: { cookie: `sessionid=${session};sessionid_sign=${sign}` },
I got the sessionid and the sessionid_sign from the browser on an already logged in instance of TradingView
I got the sessionid and the sessionid_sign from the browser on an already logged in instance of TradingView
If your current browser sessionId and sessionid_sign match, it should work just fine using both.
@hawooni it still isn't working :/
I even tried this:
const clientTV = new TradingView.Client({ token: process.argv[2], session: process.argv[2], sessionid_sign: "v1:j6C5uAzIpQcAfHIUMhyFESRrKWCeO/fv/mt+4qRRPsE=" });
@Mathieu2301 can you patch this please? or can anyone provide an updated miscRequests.js with corresponding login via token example?
@hawooni it still isn't working :/
I even tried this:
const clientTV = new TradingView.Client({ token: process.argv[2], session: process.argv[2], sessionid_sign: "v1:j6C5uAzIpQcAfHIUMhyFESRrKWCeO/fv/mt+4qRRPsE=" });
Hard code the value sessionid_sign directly as mentioned above as this is just a temporary solution. Or you could try user/password method.
@hawooni The user/password method disconnects the browser session :/
are you using the vi: part or just the part after for signing?
@hawooni The user/password method disconnects the browser session :/
are you using the vi: part or just the part after for signing?
I have not tried user/password method kyr0 mentioned that it is working.
@hawooni it works well, just you cannot use TV in your browser while its running and re-logging in on browser disconnects the NodeJS session :/
@0xR-Dev does your sign look like this?
sign = "v1:j6C5uAzIpQcAfHIUMhyFESRrKWCeO/fv/mt+4qRRPsE="
After the log in method was mostly good, I'm now getting this..
Login error: Please confirm that you are not a robot by clicking the captcha box
.
temporary, if you include "sessionid=${session};sessionid_sign={YOUR_VALUE};" in miscRequests.js line 408 should work.
I have replaced line 408 to like this but I still encounter the credentials error ?
headers: { cookie: `sessionid=${session};sessionid_sign={v1:Ms/DU43561uJEfjdkbJPrz1GDBNLrl6YTIpmDY=};` },