Updated with Movistar channels

This commit is contained in:
Joan
2024-10-13 10:58:06 +02:00
parent b4788a22e3
commit 622d36700c
10 changed files with 3746 additions and 36 deletions

View File

@@ -2,6 +2,7 @@ const express = require('express');
const { spawn } = require('child_process');
const fs = require('fs');
const path = require('path');
const fetch = require('node-fetch');
const app = express();
const port = 8080;
@@ -44,8 +45,22 @@ const audios = channel.audios;
const resolution = channel.resolution;
const delay = channel.delay;
let url = channel.url;
let baseurl;
if (url.includes("telefonica.com")) {
const now = new Date();
const startTime = new Date(now.getTime() - 45000).toISOString().slice(0, -5) + "Z";
const endTime = new Date(now.getTime() + (9 * 60 * 60 * 1000)).toISOString().slice(0, -5) + "Z";
baseurl = url + `&start_time=${startTime}&end_time=${endTime}`;
url = `http://proxy_movistar:8080/` + url + `&start_time=${startTime}&end_time=${endTime}`;
}
let args = [
channel.url,
url,
'--use-shaka-packager',
'--log-level', 'OFF',
'--no-log',
@@ -106,6 +121,10 @@ if (delay) {
args.splice(1, 0, '--live-pipe-options', '-itsoffset ' + delay + ' -re -loglevel error {INPUTS} -c copy -f mpegts -fflags +genpts -shortest pipe:1');
}
if (baseurl) {
args.splice(1, 0, '--base-url', baseurl);
}
console.log(`Args: ${args}`);
const streamlinkProcess = spawn('N_m3u8DL-RE', args);