Skip to content

Commit

Permalink
Allow for specifying custom base url in install process (#2)
Browse files Browse the repository at this point in the history
* Allow for specifying custom base url in install process

* update readme

* more detail in readme

* always log base url
  • Loading branch information
srubin authored Feb 2, 2021
1 parent de47039 commit 86a3b73
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ This module is installed via npm:
$ npm install ffmpeg-ffprobe-static
```

*Note:* During installation, it will download the appropriate `ffmpeg` binary from the [`b4.3.1` GitHub release](https://github.com/descriptinc/ffmpeg-ffprobe-static/releases/tag/b4.3.1). Use and distribution of the binary releases of FFmpeg are covered by their respective license.
*Note:* During installation, it will download the appropriate `ffmpeg`/`ffprobe` binary from the [`b4.3.1` GitHub release](https://github.com/descriptinc/ffmpeg-ffprobe-static/releases/tag/b4.3.1). Use and distribution of the binary releases of FFmpeg are covered by their respective license.

Alternatively, it will fetch binaries from `FFMPEG_FFPROBE_STATIC_BASE_URL` if set as an environment variable. The default base URL is https://github.com/descriptinc/ffmpeg-ffprobe-static/releases/download/. The install script will fetch binaries from `BASE_URL/binary-release-tag` (the `binary-release-tag` is set in package.json and can customized by setting `FFMPEG_BINARY_RELEASE`).


### Electron & other cross-platform packaging tools

Expand Down
4 changes: 3 additions & 1 deletion install.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ const releaseName = (
)
const arch = process.env.npm_config_arch || os.arch()
const platform = process.env.npm_config_platform || os.platform()
let baseUrl = `https://github.com/descriptinc/ffmpeg-ffprobe-static/releases/download/${release}`;
const base = process.env.FFMPEG_FFPROBE_STATIC_BASE_URL || 'https://github.com/descriptinc/ffmpeg-ffprobe-static/releases/download/';
console.log(`[ffmpeg-ffprobe-static] Using base url: ${base}`);
const baseUrl = new URL(release, base).href;
const ffmpegUrl = `${baseUrl}/ffmpeg-${platform}-${arch}`
const ffprobeUrl = `${baseUrl}/ffprobe-${platform}-${arch}`
const readmeUrl = `${baseUrl}/${platform}-${arch}.README`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffmpeg-ffprobe-static",
"version": "4.3.1-rc.2",
"version": "4.3.1-rc.3",
"description": "ffmpeg static binaries for Mac OSX and Linux and Windows",
"main": "index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 86a3b73

Please sign in to comment.