Compare commits

...

2 Commits

Author SHA1 Message Date
DebaucheryLibrarian
a77ce63548 1.248.44 2026-02-08 03:51:44 +01:00
DebaucheryLibrarian
85a5f13ec1 Added stream selection by hostname, improved config structure. 2026-02-08 03:51:41 +01:00
4 changed files with 18 additions and 11 deletions

View File

@@ -416,11 +416,14 @@ module.exports = {
trailerQuality: [540, 720, 960, 480, 1080, 360, 320, 1440, 1600, 1920, 2160, 270, 240, 180],
limit: 25, // max number of photos per release
attempts: 2,
fetchStreams: true,
streamConcurrency: 2, // max number of video streams (m3u8 etc.) to fetch and process at once
streamExcludeHostnames: [], // resource hogs
flushOrphaned: true,
flushWindow: 1000,
streams: {
enabled: true, // fetch streams
concurrency: 2,
excludeHostnames: [],
selectIndex: {},
},
},
titleSlugLength: 50,
};

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "traxxx",
"version": "1.248.43",
"version": "1.248.44",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "traxxx",
"version": "1.248.43",
"version": "1.248.44",
"license": "ISC",
"dependencies": {
"@aws-sdk/client-s3": "^3.458.0",

View File

@@ -1,6 +1,6 @@
{
"name": "traxxx",
"version": "1.248.43",
"version": "1.248.44",
"description": "All the latest porn releases in one place",
"main": "src/app.js",
"scripts": {

View File

@@ -671,16 +671,20 @@ async function fetchHttpSource(source, tempFileTarget, hashStream) {
streamQueue.define('fetchStreamSource', async ({ source, tempFileTarget, hashStream }) => {
const meta = { mimetype: 'video/mp4' };
const { hostname } = new URL(source.stream);
if (config.media.streamExcludeHostnames.includes(hostname)) {
if (config.media.streams.excludeHostnames.includes(hostname)) {
throw new Error(`Stream source hostname ${hostname} is excluded by config`);
}
const streamIndex = config.media.streams.selectIndex[hostname];
const command = ffmpeg(source.stream)
.format('mp4')
.outputOptions(['-movflags frag_keyframe+empty_moov'])
.outputOptions([
'-movflags frag_keyframe+empty_moov',
...(typeof streamIndex === 'number' ? [`-map p:${streamIndex}`] : []),
])
.on('start', (cmd) => logger.verbose(`Fetching stream from ${source.stream} with "${cmd}"`));
const video = command.pipe();
@@ -706,7 +710,7 @@ streamQueue.define('fetchStreamSource', async ({ source, tempFileTarget, hashStr
return meta;
}, {
concurrency: config.media.streamConcurrency,
concurrency: config.media.streams.concurrency,
});
async function fetchSource(source, baseMedia) {
@@ -715,7 +719,7 @@ async function fetchSource(source, baseMedia) {
logger.silly(`Fetching media from ${source.src}`);
logger.debug(`Memory usage before media fetch: ${process.memoryUsage.rss() / 1000000} MB (${source.src})`);
if (source.stream && !config.media.fetchStreams) {
if (source.stream && !config.media.streams.enabled) {
throw new Error(`Stream fetching disabled, ignoring ${source.stream}`);
}