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

Can't login with credentials #299

Open
FelixFreelancer opened this issue Jul 11, 2022 · 14 comments
Open

Can't login with credentials #299

FelixFreelancer opened this issue Jul 11, 2022 · 14 comments

Comments

@FelixFreelancer
Copy link

Hi @mikedidomizio

The login function stops working for some reason.
I've attached my code and errors given.

const boxrec = require("boxrec").Boxrec;

(async() => {
    try {

        const BOXREC_USERNAME = process.env.BOXREC_USERNAME;
        const BOXREC_PASSWORD = process.env.BOXREC_PASSWORD;
        const cookie = await boxrec.login(BOXREC_USERNAME , BOXREC_PASSWORD );
      
    } catch(e) {
        console.log(e)
    }
})();

When I run the code above, it gives this error for some reason.

Error: Could not get redirect URL
    at Function.<anonymous> (E:\boxrec\node_modules\boxrec-requests\dist\boxrec-requests.js:481:35)
    at step (E:\boxrec\node_modules\boxrec-requests\dist\boxrec-requests.js:33:23)
    at Object.next (E:\boxrec\node_modules\boxrec-requests\dist\boxrec-requests.js:14:53)
    at fulfilled (E:\boxrec\node_modules\boxrec-requests\dist\boxrec-requests.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Thanks

@mikedidomizio
Copy link
Member

This appears to be a result of BoxRec implementing CloudFlare to prevent bots. Not sure about a solution for this at this time.

@FelixFreelancer
Copy link
Author

Is there a way to bypass it?
Thanks

@FelixFreelancer
Copy link
Author

If we get the cookie manually from the website, the rest function(getDate(), getBout()) will be able to work?

@mikedidomizio
Copy link
Member

If we get the cookie manually from the website, the rest function(getDate(), getBout()) will be able to work?

It's worth a try to at least unblock you for now.

@FelixFreelancer
Copy link
Author

I just tried it. but still gives the same error.
I have another question. If I use a good proxy server, the issue might be resolved?

Thanks

@mikedidomizio
Copy link
Member

I still think regardless the issue is still valid but any workaround might be fine until a full solution is figured out.

@FelixFreelancer
Copy link
Author

If we get the cookie manually from the website, the rest function(getDate(), getBout()) will be able to work?

It's worth a try to at least unblock you for now.

I took a cookie from a web browser.
And tried to get schedules by using it.

const cookie = "_ga=GA1.1.265210831.1656540311; wXw2E7NF36pq4KmR4Eu3LBIQNlH......";
let schedules2 = await boxrec.getDate(cookie, {
    day: 17,
    month: 7,
    year: 2022
});

But it still gives invalid results.
Could you please check if I can use the cookie as a string itself taken from the website?

Thanks

@FelixFreelancer
Copy link
Author

I also noticed that boxrec recently changed their website including layout and so on.
Probably this issue is related to this?

Thanks

@mikedidomizio
Copy link
Member

That's a separate issue and I can already tell there's going to be some stuff broken as a result of that.

As far as the CloudFlare stuff that resulted in Could not get redirect URL, I have a potential solution but it requires a bunch of testing.

No ETA on this.

@FelixFreelancer
Copy link
Author

Hi @mikedidomizio

Could you kindly let me know when you'd like to upgrade the package?
I really appreciate for your continuous upgrading this package.

Thanks

@FelixFreelancer
Copy link
Author

Hi @mikedidomizio

Could you please let me know if there are any updates?
Thanks

@mikedidomizio
Copy link
Member

The only update I can give is the changes required to make the API requests from the underlying boxrec-requests package are still in (slow) progress.

@mikedidomizio
Copy link
Member

Just an update on this since I can't promise much more work on it at this time, but in case someone wants to try and continue fixing it.

The underlying boxrec-requests has a puppeteer branch to try and fetch via puppeteer to handle captchas. It's not perfect but functions. This repository is still in need of having an update since the BoxRec website has changed visually.

@debabrataroytechnoexponent

Facing same issue with all the versions.

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

3 participants