1
0
mirror of https://github.com/snobu/destreamer.git synced 2026-01-23 00:12:16 +00:00

Group parsing fix and error out on old ffmpeg version (#298)

* fixed parsing for group with more than 100 videos

* updated all packages to latest version

* Error on old ffmpeg binaries (closes #294)
minor linting fixes

* automatic update of files

Co-authored-by: Adrian Calinescu <foo@snobu.org>
This commit is contained in:
lukaarma
2021-01-13 19:12:12 +01:00
committed by GitHub
parent 58122d5c4e
commit f8207f4fd1
10 changed files with 5463 additions and 1372 deletions

View File

@@ -19,16 +19,16 @@ export class TokenCache {
return null;
}
let session: Session = JSON.parse(fs.readFileSync(this.tokenCacheFile, 'utf8'));
const session: Session = JSON.parse(fs.readFileSync(this.tokenCacheFile, 'utf8'));
type Jwt = {
[key: string]: any
}
const decodedJwt: Jwt = jwtDecode(session.AccessToken);
let now: number = Math.floor(Date.now() / 1000);
let exp: number = decodedJwt['exp'];
let timeLeft: number = exp - now;
const now: number = Math.floor(Date.now() / 1000);
const exp: number = decodedJwt['exp'];
const timeLeft: number = exp - now;
if (timeLeft < 120) {
logger.warn('Access token has expired! \n');
@@ -42,7 +42,7 @@ export class TokenCache {
}
public Write(session: Session): void {
let s: string = JSON.stringify(session, null, 4);
const s: string = JSON.stringify(session, null, 4);
fs.writeFile('.token_cache', s, (err: any) => {
if (err) {
return logger.error(err);