Skip to content

Allow for specifying custom base url in install process #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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