mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-10 13:59:40 +00:00
Add:FFProbe api endpoint
This commit is contained in:
parent
a0e80772cd
commit
d0bce2949e
12 changed files with 201 additions and 114 deletions
|
|
@ -309,3 +309,23 @@ function probe(filepath, verbose = false) {
|
|||
})
|
||||
}
|
||||
module.exports.probe = probe
|
||||
|
||||
/**
|
||||
* Ffprobe for audio file path
|
||||
*
|
||||
* @param {string} filepath
|
||||
* @returns {Object} ffprobe json output
|
||||
*/
|
||||
function rawProbe(filepath) {
|
||||
if (process.env.FFPROBE_PATH) {
|
||||
ffprobe.FFPROBE_PATH = process.env.FFPROBE_PATH
|
||||
}
|
||||
|
||||
return ffprobe(filepath)
|
||||
.catch((err) => {
|
||||
return {
|
||||
error: err
|
||||
}
|
||||
})
|
||||
}
|
||||
module.exports.rawProbe = rawProbe
|
||||
Loading…
Add table
Add a link
Reference in a new issue