Compare commits

...

23 Commits

Author SHA1 Message Date
Joris Bertomeu
5dea3be1f1 Fix some tmp path issue
All checks were successful
ci / Image build (push) Successful in 3m7s
ci / Deployment (push) Successful in 26s
2025-08-27 16:50:18 +02:00
Joris Bertomeu
dac21bbe23 alot of fixes
All checks were successful
ci / Image build (push) Successful in 3m18s
ci / Deployment (push) Successful in 27s
2025-08-27 16:31:45 +02:00
Joris Bertomeu
08dd0a38a6 alot of fixes
All checks were successful
ci / Image build (push) Successful in 2m41s
ci / Deployment (push) Successful in 27s
2025-08-27 16:21:58 +02:00
Joris Bertomeu
b856269591 fix download issue
All checks were successful
ci / Image build (push) Successful in 2m36s
ci / Deployment (push) Successful in 27s
2025-08-26 20:10:11 +02:00
Joris Bertomeu
dc5c541bc4 Add upscale feat
All checks were successful
ci / Image build (push) Successful in 2m28s
ci / Deployment (push) Successful in 27s
2025-08-26 17:30:47 +02:00
Joris Bertomeu
6faebd723d Add duration
All checks were successful
ci / Image build (push) Successful in 2m12s
ci / Deployment (push) Successful in 20s
2025-08-26 11:45:31 +02:00
Joris Bertomeu
478e154d5d Fix possible github API Exceeded error
All checks were successful
ci / Image build (push) Successful in 2m10s
ci / Deployment (push) Successful in 22s
2025-08-26 11:05:29 +02:00
Joris Bertomeu
9b288ebd63 Add defaultKID opt
All checks were successful
ci / Image build (push) Successful in 2m29s
ci / Deployment (push) Successful in 23s
2025-08-26 10:42:15 +02:00
Joris Bertomeu
9025960ee0 Get video by id instead of resolution pattern
All checks were successful
ci / Image build (push) Successful in 2m25s
ci / Deployment (push) Successful in 25s
2025-08-25 17:18:36 +02:00
Joris Bertomeu
58f4901c0a Add missing wantedRemux opt
All checks were successful
ci / Image build (push) Successful in 2m27s
ci / Deployment (push) Successful in 24s
2025-08-25 16:09:59 +02:00
Joris Bertomeu
b008ff411d Add missing wantedRemux opt
All checks were successful
ci / Image build (push) Successful in 2m18s
ci / Deployment (push) Successful in 24s
2025-08-25 15:40:00 +02:00
Joris Bertomeu
9d023ef255 Add MKV Remux + fix download process
All checks were successful
ci / Image build (push) Successful in 2m21s
ci / Deployment (push) Successful in 26s
2025-08-25 15:03:58 +02:00
Joris Bertomeu
fc8e9ebc48 Fix relative to missing subtiles issue
All checks were successful
ci / Image build (push) Successful in 2m11s
ci / Deployment (push) Successful in 22s
2025-08-25 14:48:59 +02:00
Joris Bertomeu
aba85207e7 Lil fixes
All checks were successful
ci / Image build (push) Successful in 2m8s
ci / Deployment (push) Successful in 21s
2025-08-25 14:40:05 +02:00
02486aa6f6 Update index.js
All checks were successful
ci / Image build (push) Successful in 2m29s
ci / Deployment (push) Successful in 21s
2025-08-25 12:14:41 +02:00
3bd93c54fb Change redis URL
All checks were successful
ci / Image build (push) Successful in 2m4s
ci / Deployment (push) Successful in 23s
2025-08-25 11:35:55 +02:00
Joris Bertomeu
5cb2bd7518 Upgrade some pkgs
All checks were successful
ci / Image build (push) Successful in 2m41s
ci / Deployment (push) Successful in 30s
2024-11-02 16:30:46 +01:00
Joris Bertomeu
34e84d2d6b Lil fixes relative to downloader cli bad args
All checks were successful
ci / Image build (push) Successful in 2m49s
ci / Deployment (push) Successful in 20s
2024-10-02 19:08:00 +02:00
Joris Bertomeu
0a115b49e1 some lil fixes
All checks were successful
ci / Image build (push) Successful in 2m19s
ci / Deployment (push) Successful in 23s
2024-10-02 18:00:05 +02:00
Joris Bertomeu
8e57d724be Add mkvtoolnix to Dockerfile
All checks were successful
ci / Image build (push) Successful in 1m3s
ci / Deployment (push) Successful in 13s
2024-10-02 17:25:15 +02:00
Joris Bertomeu
6081892297 Add mkvtoolnix to Dockerfile
Some checks failed
ci / Image build (push) Failing after 36s
ci / Deployment (push) Failing after 3s
2024-10-02 17:23:48 +02:00
Joris Bertomeu
2910754dd0 Add mkvtoolnix to Dockerfile
Some checks failed
ci / Image build (push) Failing after 31s
ci / Deployment (push) Failing after 4s
2024-10-02 17:22:57 +02:00
Joris Bertomeu
bce02889b4 Add mkvtoolnix to Dockerfile
Some checks failed
ci / Image build (push) Failing after 44s
ci / Deployment (push) Failing after 3s
2024-10-02 17:18:11 +02:00
4 changed files with 1626 additions and 194 deletions

View File

@@ -1,9 +1,17 @@
FROM node:22-alpine
FROM node:22-bookworm-slim
WORKDIR /app
COPY package*.json ./
RUN apt update && apt install -y apt-transport-https wget
RUN wget -O /usr/share/keyrings/gpg-pub-moritzbunkus.gpg https://mkvtoolnix.download/gpg-pub-moritzbunkus.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/gpg-pub-moritzbunkus.gpg] https://mkvtoolnix.download/debian/ bookworm main" > /etc/apt/sources.list.d/mkvtoolnix.download.list \
&& echo "deb-src [signed-by=/usr/share/keyrings/gpg-pub-moritzbunkus.gpg] https://mkvtoolnix.download/debian/ bookworm main" >> /etc/apt/sources.list.d/mkvtoolnix.download.list
RUN apt update && apt install -y mkvtoolnix ffmpeg
RUN npm install --production
RUN npm install -g pm2

1593
index.js

File diff suppressed because it is too large Load Diff

View File

@@ -9,15 +9,18 @@
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^1.7.7",
"bull": "^4.16.3",
"cheerio": "^1.0.0",
"axios": "^1.11.0",
"bull": "^4.16.5",
"cheerio": "^1.1.2",
"cors": "^2.8.5",
"express": "^4.21.0",
"express": "^5.1.0",
"ffprobe": "^1.1.2",
"ffprobe-static": "^3.1.0",
"fs": "^0.0.1-security",
"mpd-parser": "^1.3.0",
"mpd-parser": "^1.3.1",
"path": "^0.12.7",
"tar": "^7.4.3",
"unzipper": "^0.12.3"
"unzipper": "^0.12.3",
"xml2js": "^0.6.2"
}
}

View File

@@ -126,6 +126,10 @@ const getLocalBinFileInfo = (binType) => {
stat: fs.existsSync(path) ? fs.statSync(path) : null,
version: getBinVersion(`${BIN_PATH}/.${binType}.version`)
}
} else if (binType === 'realesrgan') {
return {
path: `${BIN_PATH}/realesrgan_macos/realesrgan-ncnn-vulkan`
};
} else {
throw new Error(`Bad binType "${binType}" provided`);
}
@@ -154,7 +158,7 @@ const checkDownloaderUpdate = async () => {
localInfos,
remoteInfos
},
newReleaseAvailable: localInfos?.version ? parseInt(localInfos.version) !== remoteInfos?.id : remoteInfos?.name || false,
newReleaseAvailable: remoteInfos ? localInfos?.version ? parseInt(localInfos.version) !== remoteInfos?.id : remoteInfos?.name || false : false,
filsIsPresent: localInfos?.stat ? true : false
}
} catch(e) {
@@ -186,30 +190,72 @@ const processUpdate = async (data) => {
try {
let downloadURL = data.binType === 'downloader' ? data.details.remoteInfos.browser_download_url : data.details.remoteInfos.downloadUrl;
let filename = data.binType === 'downloader' ? data.details.remoteInfos.name : data.details.remoteInfos.filename;
fs.mkdirSync(tmpUpdatePath);
fs.mkdirSync(tmpUpdatePath, { recursive: true });
const zipDest = `${tmpUpdatePath}/${filename}`;
console.log('Will download file from ' + downloadURL);
await downloadFile(downloadURL, zipDest);
console.log('File downloaded to ' + zipDest)
console.log('Will decompress downloaded file');
const unzippedFolderDest = `${tmpUpdatePath}/${data.binType}_tmp`
fs.mkdirSync(unzippedFolderDest);
fs.mkdirSync(unzippedFolderDest, { recursive: true });
await extractFile(zipDest, unzippedFolderDest);
console.log('Unzipped !');
const uncompressedFoldersS = fs.readdirSync(unzippedFolderDest);
console.log(uncompressedFoldersS)
if (uncompressedFoldersS.length !== 1)
throw new Error('Unable to retrieve decompressed folder');
const uncompressedFolders = fs.readdirSync(`${unzippedFolderDest}/${uncompressedFoldersS[0]}`);
if (uncompressedFolders.length === 0)
throw new Error('Unable to retrieve archive content');
if (data.binType === 'downloader')
fs.renameSync(`${unzippedFolderDest}/${uncompressedFoldersS[0]}/${uncompressedFolders[0]}`, data.details.localInfos.path);
else if (data.binType === 'mp4decrypt')
fs.renameSync(`${unzippedFolderDest}/${uncompressedFoldersS[0]}/bin/mp4decrypt`, data.details.localInfos.path);
const extractedItems = fs.readdirSync(unzippedFolderDest);
console.log('Extracted items:', extractedItems);
if (extractedItems.length === 0) {
throw new Error('No files found after extraction');
}
if (data.binType === 'downloader') {
let binaryPath = null;
for (const item of extractedItems) {
const itemPath = `${unzippedFolderDest}/${item}`;
const stat = fs.statSync(itemPath);
if (stat.isFile() && (item === 'N_m3u8DL-RE' || item.includes('N_m3u8DL-RE'))) {
binaryPath = itemPath;
break;
} else if (stat.isDirectory()) {
const subItems = fs.readdirSync(itemPath);
const binary = subItems.find(subItem =>
subItem === 'N_m3u8DL-RE' || subItem.includes('N_m3u8DL-RE')
);
if (binary) {
binaryPath = `${itemPath}/${binary}`;
break;
}
}
}
if (!binaryPath) {
throw new Error('N_m3u8DL-RE binary not found in archive');
}
fs.renameSync(binaryPath, data.details.localInfos.path);
} else if (data.binType === 'mp4decrypt') {
if (extractedItems.length !== 1) {
throw new Error('Unable to retrieve decompressed folder for mp4decrypt');
}
const mainFolder = `${unzippedFolderDest}/${extractedItems[0]}`;
const mp4decryptPath = `${mainFolder}/bin/mp4decrypt`;
if (!fs.existsSync(mp4decryptPath)) {
throw new Error('mp4decrypt binary not found at expected path: bin/mp4decrypt');
}
fs.renameSync(mp4decryptPath, data.details.localInfos.path);
}
fs.chmodSync(data.details.localInfos.path, 0o755);
writeBinVersion(`${BIN_PATH}/.${data.binType}.version`, data.details.remoteInfos[data.binType === 'downloader' ? 'id' : 'version'])
} catch(e) {
console.error('Error during update process:', e);
throw e;
} finally {
fs.rmSync(tmpUpdatePath, { recursive: true, force: true });
@@ -250,7 +296,7 @@ const getLatestGithubReleaseAssetUrl = async (owner, repo, assetName) => {
}
} catch (error) {
console.error('Erreur:', error.message);
throw error;
return null;
}
}