Merge pull request #1096 from Sipherdrakon/fix/cr-token-expiry

Fix Crunchyroll token expiry calculation
This commit is contained in:
Stratuma 2025-10-08 16:02:30 +02:00 committed by GitHub
commit 9f6d36d364
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -425,7 +425,7 @@ export default class Crunchy implements ServiceClass {
}
this.token = await authReq.res.json();
this.token.device_id = uuid;
this.token.expires = new Date(Date.now() + this.token.expires_in);
this.token.expires = new Date(Date.now() + this.token.expires_in * 1000);
yamlCfg.saveCRToken(this.token);
await this.getProfile();
console.info('Your Country: %s', this.token.country);
@ -464,7 +464,7 @@ export default class Crunchy implements ServiceClass {
}
this.token = await authReq.res.json();
this.token.device_id = uuid;
this.token.expires = new Date(Date.now() + this.token.expires_in);
this.token.expires = new Date(Date.now() + this.token.expires_in * 1000);
yamlCfg.saveCRToken(this.token);
}
@ -535,7 +535,7 @@ export default class Crunchy implements ServiceClass {
}
this.token = await authReq.res.json();
this.token.device_id = uuid;
this.token.expires = new Date(Date.now() + this.token.expires_in);
this.token.expires = new Date(Date.now() + this.token.expires_in * 1000);
yamlCfg.saveCRToken(this.token);
await this.getProfile(false);
await this.getCMStoken(true);
@ -586,7 +586,7 @@ export default class Crunchy implements ServiceClass {
}
this.token = await authReq.res.json();
this.token.device_id = uuid;
this.token.expires = new Date(Date.now() + this.token.expires_in);
this.token.expires = new Date(Date.now() + this.token.expires_in * 1000);
yamlCfg.saveCRToken(this.token);
}
if (this.token.refresh_token) {