mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-12 20:25:06 +01:00
twitter & stream: formatting
This commit is contained in:
parent
a7eb548c2b
commit
e27c02c55e
2 changed files with 2 additions and 3 deletions
|
@ -2,9 +2,9 @@ import { genericUserAgent } from "../../config.js";
|
||||||
import { createStream } from "../../stream/manage.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????)
|
// 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 badContainerStart = new Date(1701446400000);
|
||||||
const badContainerEnd = new Date(1702605600000);
|
const badContainerEnd = new Date(1702605600000);
|
||||||
const TWITTER_EPOCH = 1288834974657n;
|
|
||||||
|
|
||||||
function needsFixing(media) {
|
function needsFixing(media) {
|
||||||
const representativeId = media.source_status_id_str ?? media.id_str;
|
const representativeId = media.source_status_id_str ?? media.id_str;
|
||||||
|
|
|
@ -18,9 +18,8 @@ streamCache.on("expired", (key) => {
|
||||||
const streamSalt = randomBytes(64).toString('hex');
|
const streamSalt = randomBytes(64).toString('hex');
|
||||||
|
|
||||||
export function createStream(obj) {
|
export function createStream(obj) {
|
||||||
let lifespan = streamLifespan
|
|
||||||
let streamID = nanoid(),
|
let streamID = nanoid(),
|
||||||
exp = Math.floor(new Date().getTime()) + lifespan,
|
exp = Math.floor(new Date().getTime()) + streamLifespan,
|
||||||
ghmac = sha256(`${streamID},${obj.service},${exp}`, streamSalt);
|
ghmac = sha256(`${streamID},${obj.service},${exp}`, streamSalt);
|
||||||
|
|
||||||
if (!streamCache.has(streamID)) {
|
if (!streamCache.has(streamID)) {
|
||||||
|
|
Loading…
Reference in a new issue