Skip to content

Commit 3319dff

Browse files
committed
wip: ffprobe
1 parent 2fe6824 commit 3319dff

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

ffprobe/releases.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
'use strict';
2+
3+
var path = require('path');
4+
5+
var github = require('../_common/github.js');
6+
var owner = 'eugeneware';
7+
var repo = 'ffmpeg-static';
8+
9+
module.exports = function (request) {
10+
return github(request, owner, repo).then(function (all) {
11+
all.releases = all.releases
12+
.filter(function (rel) {
13+
let isFfmpeg = rel.name.includes('ffmpeg');
14+
if (!isFfmpeg) {
15+
return;
16+
}
17+
18+
// remove README and LICENSE
19+
return !['.README', '.LICENSE'].includes(path.extname(rel.name));
20+
})
21+
.map(function (rel) {
22+
rel.version = rel.version.replace(/^b/, '');
23+
24+
if (/win32/.test(rel.name)) {
25+
rel.os = 'windows';
26+
rel.ext = 'exe';
27+
}
28+
if (/ia32/.test(rel.name)) {
29+
rel.arch = '386';
30+
} else if (/x64/.test(rel.name)) {
31+
rel.arch = 'amd64';
32+
}
33+
34+
return rel;
35+
});
36+
return all;
37+
});
38+
};
39+
40+
if (module === require.main) {
41+
module.exports(require('@root/request')).then(function (all) {
42+
all = require('../_webi/normalize.js')(all);
43+
console.info(JSON.stringify(all));
44+
});
45+
}

0 commit comments

Comments
 (0)