Updated with Movistar channels
This commit is contained in:
@@ -41,8 +41,8 @@ COPY ./server.js .
|
||||
# && rm -rf /tmp/ffmpeg-*
|
||||
|
||||
#Download and config N_m3u8DL-RE
|
||||
RUN wget https://github.com/nilaoda/N_m3u8DL-RE/releases/download/v0.2.0-beta/N_m3u8DL-RE_Beta_linux-x64_20230628.tar.gz \
|
||||
&& tar xf N_m3u8DL-RE_Beta_linux-x64_20230628.tar.gz --strip-components 1 \
|
||||
RUN wget https://github.com/nilaoda/N_m3u8DL-RE/releases/download/v0.2.1-beta/N_m3u8DL-RE_Beta_linux-x64_20240828.tar.gz \
|
||||
&& tar xf N_m3u8DL-RE_Beta_linux-x64_20240828.tar.gz --strip-components 1 \
|
||||
&& chmod +x N_m3u8DL-RE \
|
||||
&& mv N_m3u8DL-RE /usr/local/bin
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"author": "",
|
||||
"license": "",
|
||||
"dependencies": {
|
||||
"express": "^4.18.2"
|
||||
"express": "^4.18.2",
|
||||
"node-fetch": "^2.6.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user