Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled rejection StatusCodeError: 403 #30

Open
123tomek opened this issue Oct 23, 2021 · 1 comment
Open

Unhandled rejection StatusCodeError: 403 #30

123tomek opened this issue Oct 23, 2021 · 1 comment

Comments

@123tomek
Copy link

123tomek commented Oct 23, 2021

Cześć!
Co trzeba zrobić poza zainstalowaniem node.js i npm install librus-api? Potrzebne jest coś jeszcze?
By w konsoli uzyskać np. szczęśliwy numerek utworzyłem taki skrypt:
'use strict'; const Librus = require("librus-api"); let client = new Librus(); client.authorize("mojlogin", "haslo").then(function () { console.log(client.info.getLuckyNumber().then(data => {})); });

I wyświetla zamiast tej liczby masę tekstu:

Unhandled rejection StatusCodeError: 403 - "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
...
</body>\r\n    </html>\r\n  "
    at new StatusCodeError (C:\Users\Tomek\node_modules\request-promise-core\lib\errors.js:32:15)
    at Request.plumbing.callback (C:\Users\Tomek\node_modules\request-promise-core\lib\plumbing.js:104:33)
    at Request.RP$callback [as _callback] (C:\Users\Tomek\node_modules\request-promise-core\lib\plumbing.js:46:31)
    at Request.self.callback (C:\Users\Tomek\node_modules\request\request.js:185:22)
    at Request.emit (events.js:400:28)
    at Request.<anonymous> (C:\Users\Tomek\node_modules\request\request.js:1154:10)
    at Request.emit (events.js:400:28)
    at Gunzip.<anonymous> (C:\Users\Tomek\node_modules\request\request.js:1076:12)
    at Object.onceWrapper (events.js:519:28)
    at Gunzip.emit (events.js:400:28)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections `(internal/process/task_queues.js:82:21)`

Te wyniki mają być jakoś przekierowane na stronę www z konsoli? Totalnie nie znam się na js ani na node.

@Mati365
Copy link
Owner

Mati365 commented Oct 23, 2021

Cześć, nie mam bladego pojęcia. Wywala ci się tylko na tej funkcji? Inne działają?

edit: Podbiłem przed chwilą wersję z NPM z paroma ostatnimi zmianami, zerknij

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants