mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[addon] show filename at the end of moch url for external players
This commit is contained in:
@@ -6,4 +6,13 @@ function chunkArray(arr, size) {
|
||||
: [arr];
|
||||
}
|
||||
|
||||
module.exports = { chunkArray, BadTokenError }
|
||||
function streamFilename(stream) {
|
||||
const titleParts = stream.title.replace(/\n👤.*/s, '').split('\n');
|
||||
const filePath = titleParts.pop();
|
||||
const filename = titleParts.length
|
||||
? filePath.split('/').pop()
|
||||
: filePath;
|
||||
return encodeURIComponent(filename)
|
||||
}
|
||||
|
||||
module.exports = { chunkArray, BadTokenError, streamFilename }
|
||||
|
||||
Reference in New Issue
Block a user