mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
append filename to debrid meta streams
This commit is contained in:
@@ -140,10 +140,9 @@ export async function getMochItemMeta(mochKey, itemId, config) {
|
|||||||
.then(meta => enrichMeta(meta))
|
.then(meta => enrichMeta(meta))
|
||||||
.then(meta => {
|
.then(meta => {
|
||||||
meta.videos
|
meta.videos
|
||||||
.map(video => video.streams)
|
.map(video => video.streams
|
||||||
.reduce((a, b) => a.concat(b), [])
|
.filter(stream => !stream.url.startsWith('http'))
|
||||||
.filter(stream => !stream.url.startsWith('http'))
|
.forEach(stream => stream.url = `${config.host}/${moch.key}/${stream.url}/${streamFilename(video)}`))
|
||||||
.forEach(stream => stream.url = `${config.host}/${moch.key}/${stream.url}`)
|
|
||||||
return meta;
|
return meta;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,10 +12,7 @@ export function chunkArray(arr, size) {
|
|||||||
|
|
||||||
export function streamFilename(stream) {
|
export function streamFilename(stream) {
|
||||||
const titleParts = stream.title.replace(/\n👤.*/s, '').split('\n');
|
const titleParts = stream.title.replace(/\n👤.*/s, '').split('\n');
|
||||||
const filePath = titleParts.pop();
|
const filename = titleParts.pop().split('/').pop();
|
||||||
const filename = titleParts.length
|
|
||||||
? filePath.split('/').pop()
|
|
||||||
: filePath;
|
|
||||||
return encodeURIComponent(filename)
|
return encodeURIComponent(filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user