Skip to content

Commit

Permalink
wip: ffprobe
Browse files Browse the repository at this point in the history
  • Loading branch information
coolaj86 committed Nov 14, 2023
1 parent aa03b9e commit 0e18d46
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions ffprobe/releases.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
'use strict';

var path = require('path');

var github = require('../_common/github.js');
var owner = 'eugeneware';
var repo = 'ffmpeg-static';

module.exports = function (request) {
return github(request, owner, repo).then(function (all) {
all.releases = all.releases
.filter(function (rel) {
let isFfmpeg = rel.name.includes('ffmpeg');
if (!isFfmpeg) {
return;
}

// remove README and LICENSE
return !['.README', '.LICENSE'].includes(path.extname(rel.name));
})
.map(function (rel) {
rel.version = rel.version.replace(/^b/, '');

if (/win32/.test(rel.name)) {
rel.os = 'windows';
rel.ext = 'exe';
}
if (/ia32/.test(rel.name)) {
rel.arch = '386';
} else if (/x64/.test(rel.name)) {
rel.arch = 'amd64';
}

return rel;
});
return all;
});
};

if (module === require.main) {
module.exports(require('@root/request')).then(function (all) {
all = require('../_webi/normalize.js')(all);
console.info(JSON.stringify(all));
});
}

0 comments on commit 0e18d46

Please sign in to comment.