Eywek / tgvmax-bot

26 stars 6 forks source link

Token passengers undefined, tgvmax-bot deprecated ? #24

Closed yohann84L closed 2 years ago

yohann84L commented 2 years ago

When adding trainline or sncf booker I always get the following error if I search for train:

/usr/src/src/book/trainline.ts:298
    this.token.passengers = token.passengers.filter(p => p.is_selected)
                                            ^
TypeError: Cannot read properties of undefined (reading 'filter')
    at TrainlineAuthentifier.login (/usr/src/src/book/trainline.ts:298:46)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at TrainlineAuthentifier.getToken (/usr/src/src/book/trainline.ts:262:7)
    at TrainlineSearcher.search (/usr/src/src/book/trainline.ts:654:22)
    at Object.next (/usr/src/src/book/trainline.ts:552:21)
    at next (node:internal/streams/from:85:11)

I tried to run the POST request manually and I got:

{
    "errors": {
        "email": [
            "Sorry! No matching account was found for this email address or password."
        ]
    }
}

But my email and password are correct. However, if I look to the request sent on https://www.thetrainline.com/, the url is https://www.thetrainline.com/login-service/api/login and not https://www.trainline.fr/api/v5_1

Does this bot still work ? Or the trainline api have changed and kill this bot ?

Eywek commented 2 years ago

Hello,

The bot still work, you need to use a Business Trainline account instead of a normal one to be able to use it

JulianSchl commented 1 year ago

I am getting the same error even with a business account. Strangely I got the response once and after that the same request delivered an error 502

MrVidipy commented 1 year ago

Hi, I have had the same problem since this morning. When I go to https://www.trainline.fr/api/v5_1/account/signin in my browser, I have the return {"error":"Une erreur système est survenue."} The bot was working fine before. Is trainline down?