From e27c02c55ee05fc19cff010e53e9a4497c21e1aa Mon Sep 17 00:00:00 2001 From: wukko Date: Sun, 17 Dec 2023 23:50:04 +0600 Subject: [PATCH] twitter & stream: formatting --- src/modules/processing/services/twitter.js | 2 +- src/modules/stream/manage.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/processing/services/twitter.js b/src/modules/processing/services/twitter.js index b59e0d99..ef08cf70 100644 --- a/src/modules/processing/services/twitter.js +++ b/src/modules/processing/services/twitter.js @@ -2,9 +2,9 @@ import { genericUserAgent } from "../../config.js"; import { createStream } from "../../stream/manage.js"; // fix all videos affected by the container bug in twitter muxer (took them over two weeks to fix it????) +const TWITTER_EPOCH = 1288834974657n; const badContainerStart = new Date(1701446400000); const badContainerEnd = new Date(1702605600000); -const TWITTER_EPOCH = 1288834974657n; function needsFixing(media) { const representativeId = media.source_status_id_str ?? media.id_str; diff --git a/src/modules/stream/manage.js b/src/modules/stream/manage.js index 3ec43b68..1faaa38c 100644 --- a/src/modules/stream/manage.js +++ b/src/modules/stream/manage.js @@ -18,9 +18,8 @@ streamCache.on("expired", (key) => { const streamSalt = randomBytes(64).toString('hex'); export function createStream(obj) { - let lifespan = streamLifespan let streamID = nanoid(), - exp = Math.floor(new Date().getTime()) + lifespan, + exp = Math.floor(new Date().getTime()) + streamLifespan, ghmac = sha256(`${streamID},${obj.service},${exp}`, streamSalt); if (!streamCache.has(streamID)) {