From b2e1832f2c11ae7456246f787e7782ba5711f64a Mon Sep 17 00:00:00 2001 From: ulrich Date: Sat, 16 Nov 2024 14:59:50 +0000 Subject: [PATCH] channels.conf angepasst --- web/app.js | 42 ++++++++++++++++++++++++++++++++++++------ 1 files changed, 36 insertions(+), 6 deletions(-) diff --git a/web/app.js b/web/app.js index 01560dd..b271742 100644 --- a/web/app.js +++ b/web/app.js @@ -22,6 +22,7 @@ var mone; var channels; var outPath; + var senderliste; /** * Den Aufnahmeplaner initialisieren @@ -34,6 +35,7 @@ self.mone = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']; + self.senderliste = new Array(); /* * die folgenden Konstanten koennten auch ueber eine Konfigurationsdatei * oder eine API vom Server bereitgestellt werden @@ -55,7 +57,7 @@ * initial die Einstellungen einsammeln und * an der Bedienoberflaeche zeigen */ - self.collectSettings(); + //self.collectSettings(); }; /** @@ -108,12 +110,19 @@ var bez = document.getElementById("bez").value; var dotpos = bez.indexOf("."); var fname = self.outPath; - var sender = document.getElementById("sender").value; + var senderElem = document.getElementById("sender"); + var sender = senderElem.options[senderElem.selectedIndex].text; + + var streamData = self.senderliste[senderElem.selectedIndex]; + var streamElems = streamData.split("|"); + var streamFreq = streamElems[1]; + + if(dotpos > -1) { fname = fname + bez.substring(0, dotpos) + "-" + self.fts(start) + "-" + sender + bez.substring(dotpos); } else { - fname = fname + bez + "-" + self.fts(start) + "-" + sender + ".ts"; + fname = fname + bez + "-" + self.fts(start) + "-" + sender + ".mp4"; } infotext = infotext + "<br>" + fname; @@ -129,12 +138,29 @@ * echo "gnutv -channels /media/extssd/mc/channels.conf * -out file /home/fred/work/test-2020-02-01-1050-arteHD.ts * -timeout 300 arteHD" | at 1050 feb 01 + * + * echo "ffmpeg -i https://artesimulcast.akamaized.net/hls/live/2030993/artelive_de/index.m3u8 + * -t 10800 -acodec copy -vcodec copy + * /home/ulli/tv/triangle-of-sadness-2024-11-17-2005-arte-HD.mp4" | at 2005 nov 17 + * + * */ - document.getElementById("cmd").innerHTML = 'echo "gnutv -channels ' + /*document.getElementById("cmd").innerHTML = 'echo "gnutv -channels ' + self.channels + ' -out file ' + fname + ' -timeout ' + dauerSekunden + ' ' + sender + '" | at ' + self.zeitZuText(start) + ' ' + + self.mone[start.getMonth()] + ' ' + start.getDate();*/ + document.getElementById("cmd").innerHTML = 'echo "ffmpeg -i ' + + streamFreq + ' -t ' + dauerSekunden + + ' -acodec copy -vcodec copy ' + fname + '" | at ' + self.zeitZuText(start) + ' ' + self.mone[start.getMonth()] + ' ' + start.getDate(); + + /* + + ' -out file ' + + fname + ' -timeout ' + dauerSekunden + ' ' + sender + + '" | at ' + self.zeitZuText(start) + ' ' + + self.mone[start.getMonth()] + ' ' + start.getDate(); + */ }; /* @@ -173,11 +199,15 @@ self.http_get(url, function (antwort) { var zeilen = antwort.split("\n"); zeilen.sort(); + self.senderliste = zeilen; var senderAuswahl = document.getElementById("sender"); var sender; + var zElems; for(var i = 0; i < zeilen.length; i++) { - sender = document.createElement("option"); - sender.textContent = zeilen[i].split(":")[0]; + zElems = zeilen[i].split("|"); + sender = document.createElement("option"); + sender.textContent = zElems[0]; + sender.value = zElems[1]; senderAuswahl.appendChild(sender); } }); -- Gitblit v1.9.3