alot of fixes
This commit is contained in:
6
index.js
6
index.js
@@ -385,10 +385,10 @@ const formatDuration = (seconds) => {
|
||||
|
||||
const parseMPDStream = async (mpdUrl) => {
|
||||
// Télécharger le manifest d'abord
|
||||
await downloadMPDManifest(mpdUrl, `./data/tmp/manifest.mpd`);
|
||||
await downloadMPDManifest(mpdUrl, `${TMP_PATH}/manifest.mpd`);
|
||||
|
||||
// 1. Parser le XML pour récupérer les KID
|
||||
const mpdContent = fs.readFileSync('./data/tmp/manifest.mpd', 'utf8');
|
||||
const mpdContent = fs.readFileSync(`${TMP_PATH}/manifest.mpd`, 'utf8');
|
||||
const parser = new xml2js.Parser({ explicitArray: false, mergeAttrs: true });
|
||||
const parsedXML = await parser.parseStringPromise(mpdContent);
|
||||
|
||||
@@ -430,7 +430,7 @@ const parseMPDStream = async (mpdUrl) => {
|
||||
// 2. Parser avec N_m3u8DL-RE pour avoir les bonnes données
|
||||
const baseUrl = mpdUrl.substring(0, mpdUrl.lastIndexOf('/') + 1);
|
||||
const downloaderPath = softwareService.getLocalBinFileInfo('downloader').path;
|
||||
const parseCommand = `${downloaderPath} "./data/tmp/manifest.mpd" --base-url "${baseUrl}" --skip-download -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:142.0) Gecko/20100101 Firefox/142.0"`;
|
||||
const parseCommand = `${downloaderPath} "${TMP_PATH}/tmp/manifest.mpd" --base-url "${baseUrl}" --skip-download -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:142.0) Gecko/20100101 Firefox/142.0"`;
|
||||
|
||||
let stdout;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user