Open Error404-RedRose opened 4 years ago
In my mind, the API has not access key. Is there any error message screen shot or more useful info?
2020-09-16T18:07:53.983401+00:00 app[worker.1]: { statusCode: 401, statusMessage: 'Unauthorized' }
thats all
This is a global issue with any bot running this server side
but likely something simple to fix with a access key
Im currently trying to find more about heroku's oath
What is the name for the token oath? example BAIDU_TOKEN=123351232534545323424
???
I got a oath token from Heroku now I just need the Token name to put it in the heroku config vars
It may be this token. The token store in a config file in your local env. It should be store failed in heroku.
FANYI_BAIDU_URL ?
or just the word: token ?
is that a static token?
can you ask the developer to make a token save file please... I really need to get this to work asap for a server
I tried to make a function that writes a json token + value and although its coded good the token isnt being updated at all even when I call though the script. So again can you please ask developer to make a token save file?
I add a globalConfig at the lastest version. you can set useLocalStore: true
. The token config will store in local memory not the config file.
const translate = require("baidu-translate-api");
translate.setGlobalConfig({ useLocalStore: true });
// TODO translate ....
thanks allot
the storing doesn't update for me. I tried executing: translate.setGlobalConfig({ useLocalStore: true }); and used the full translator. to see if it would update.
I think its because when I execute translate.setGlobalConfig({ useLocalStore: true }); it doesn't change the globalConfig.js
but I even set the globalConfig.js to true manually and it didn't do anything. I don't see why it doesn't work your code seems good.
I'm sorry for that. I fixed at lastest version.
neither the token or useLocalStore updated still after using the function. I reinstalled all my modules it has no vulnerabilities.
it may have not been pushed to npm yet
I have pushed to npm at that time. The lastest version is 0.4.3. pls make it sure.
I updated but your new update doesnt have modules in baidu-translate-api folder
so it doesn't run
Is there any news on solving this problem? I'm interested too.
thanks!
I'm facing the same issue as well.
I tried waiting for half an hour after getting the "Unauthorized" error to see if it's because of exceeding some limits, but it doesn't work.
Setting the translate.setGlobalConfig({ useLocalStore: true });
doesn't seem to change anything.
For now until we get an update on this matter run your app client side so the TOKEN is valid by your PC client updates
Hey, has anyone found a solution to this problem? As far as I can see, the problem revolves around the generation of a new token. @TimLuo465 is there a way I can trigger the token.js script manually? Or can you help me understand the way it works because I can't seem to open the url you've provided in the script?
I made a discord bot translator with your API and its works fine client side server, But when I uploaded the bot to Heroku I get the error listed in the title. I did give HEROKU_API_KEY a proper key but I think I may need a key for Your API to access the site on Heroku server side client. But I'm not certain where the Unauthorized is happening, any help?