ffmpeg-update 3.1.1__tar.gz → 3.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ffmpeg_update-3.1.1 → ffmpeg_update-3.1.2}/PKG-INFO +17 -39
- {ffmpeg_update-3.1.1 → ffmpeg_update-3.1.2}/README.md +16 -38
- {ffmpeg_update-3.1.1 → ffmpeg_update-3.1.2}/pyproject.toml +1 -1
- {ffmpeg_update-3.1.1 → ffmpeg_update-3.1.2}/src/ffmpeg_update/__init__.py +22 -20
- {ffmpeg_update-3.1.1 → ffmpeg_update-3.1.2}/src/ffmpeg_update/__main__.py +0 -0
- {ffmpeg_update-3.1.1 → ffmpeg_update-3.1.2}/src/ffmpeg_update/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: ffmpeg-update
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.2
|
|
4
4
|
Summary: Package manager for FFmpeg, FFprobe, and FFplay static binaries
|
|
5
5
|
Keywords: updater,installer,downloader,program,executable,binary,command,line,cli,tool
|
|
6
6
|
Author: Asadullah Shaikh
|
|
@@ -34,16 +34,12 @@ FFmpeg-update is a package manager for the FFmpeg suite, available as both a CLI
|
|
|
34
34
|
|
|
35
35
|
# Features
|
|
36
36
|
|
|
37
|
-
-
|
|
38
|
-
- Fetch latest *release* or *snapshot* builds
|
|
39
|
-
- Configure custom installation location
|
|
40
|
-
- Update to latest version
|
|
41
|
-
- Check for updates
|
|
37
|
+
- Atomic installation
|
|
42
38
|
- Concurrent downloads
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
39
|
+
- Download progress bars
|
|
40
|
+
- Configurable installation directory
|
|
41
|
+
- Latest *release* and *snapshot* builds available
|
|
42
|
+
- Automatic sudo escalation for privileged installation directory
|
|
47
43
|
- Automatic operating system and machine architecture detection
|
|
48
44
|
|
|
49
45
|
# Installation
|
|
@@ -65,7 +61,7 @@ ffup <install|update [--dry-run]|check|uninstall> [OPTIONS] [ffmpeg] [ffprobe] [
|
|
|
65
61
|
Alternatively, can be invoked as a module with `python -m ffmpeg_update <COMMAND>`.
|
|
66
62
|
|
|
67
63
|
> [!TIP]
|
|
68
|
-
> Multiple names can be passed, e.g
|
|
64
|
+
> Multiple names can be passed, e.g., `ffup install ffmpeg ffprobe`
|
|
69
65
|
|
|
70
66
|
> [!NOTE]
|
|
71
67
|
> Default is `ffmpeg`, if no name is passed
|
|
@@ -73,32 +69,32 @@ Alternatively, can be invoked as a module with `python -m ffmpeg_update <COMMAND
|
|
|
73
69
|
## Parameters
|
|
74
70
|
|
|
75
71
|
- `--dir`: The path to the installation directory
|
|
76
|
-
- Environment variable: `$FFUP_DIR`/`$XDG_BIN_HOME`
|
|
77
72
|
- Default: `~/.local/bin`
|
|
78
|
-
-
|
|
73
|
+
- Environment variable: `$FFUP_DIR`, `$XDG_BIN_HOME`
|
|
74
|
+
- Commands: `check`, `install`, `uninstall`, `update`
|
|
79
75
|
|
|
80
76
|
- `--build`: The build type
|
|
77
|
+
- Default: `snapshot`
|
|
81
78
|
- Choices: `release`, `snapshot`
|
|
82
79
|
- Environment Variable: `$FFUP_BUILD`
|
|
83
|
-
-
|
|
84
|
-
- Functions: `check`, `install`, `update`
|
|
80
|
+
- Commands: `check`, `install`, `update`
|
|
85
81
|
|
|
86
82
|
- `--arch`: The machine architecture
|
|
83
|
+
- Default: Auto-detect using `platform.machine()`
|
|
87
84
|
- Choices: `amd64`, `arm64`
|
|
88
85
|
- Environment Variable: `$FFUP_ARCH`
|
|
89
|
-
-
|
|
90
|
-
- Functions: `check`, `install`, `update`
|
|
86
|
+
- Commands: `check`, `install`, `update`
|
|
91
87
|
|
|
92
88
|
- `--os`: The operating system
|
|
89
|
+
- Default: Auto-detect using `platform.system()`
|
|
93
90
|
- Choices: `linux`, `macos`
|
|
94
91
|
- Environment Variable: `$FFUP_OS`
|
|
95
|
-
-
|
|
96
|
-
- Functions: `check`, `install`, `update`
|
|
92
|
+
- Commands: `check`, `install`, `update`
|
|
97
93
|
|
|
98
94
|
- `--dry-run`: A flag to skip download/install, and only check for updates
|
|
99
|
-
- `ffup check` is an alias for `ffup update --dry-run`
|
|
100
95
|
- Default: `False`
|
|
101
|
-
-
|
|
96
|
+
- Commands: `update`
|
|
97
|
+
- Note: `ffup check` is an alias for `ffup update --dry-run`
|
|
102
98
|
|
|
103
99
|
# API Reference
|
|
104
100
|
|
|
@@ -127,21 +123,3 @@ Alternatively, can be invoked as a module with `python -m ffmpeg_update <COMMAND
|
|
|
127
123
|
> - `build`: `"release"`, `"snapshot"`
|
|
128
124
|
> - `arch`: `"amd64"`, `"arm64"`
|
|
129
125
|
> - `os`: `"linux"`, `"macos"`
|
|
130
|
-
|
|
131
|
-
# Error Handling
|
|
132
|
-
|
|
133
|
-
## `FileNotFoundError`
|
|
134
|
-
|
|
135
|
-
- By design, all operations will fail if the path in question does not exist
|
|
136
|
-
- For new installations, ensure that the installation directory exists
|
|
137
|
-
- For other operations, ensure that the path points to the installed binary
|
|
138
|
-
|
|
139
|
-
## `HTTPError`
|
|
140
|
-
|
|
141
|
-
- `404 Client Error: Not Found for url: ...`
|
|
142
|
-
- Caused by invalid values for one or more of `build`, `arch`, and `os` parameters
|
|
143
|
-
|
|
144
|
-
## `PermissionError`
|
|
145
|
-
|
|
146
|
-
- Triggers automatic escalation via `sudo`
|
|
147
|
-
- The user is prompted for a password at `stdin`
|
|
@@ -5,16 +5,12 @@ FFmpeg-update is a package manager for the FFmpeg suite, available as both a CLI
|
|
|
5
5
|
|
|
6
6
|
# Features
|
|
7
7
|
|
|
8
|
-
-
|
|
9
|
-
- Fetch latest *release* or *snapshot* builds
|
|
10
|
-
- Configure custom installation location
|
|
11
|
-
- Update to latest version
|
|
12
|
-
- Check for updates
|
|
8
|
+
- Atomic installation
|
|
13
9
|
- Concurrent downloads
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
10
|
+
- Download progress bars
|
|
11
|
+
- Configurable installation directory
|
|
12
|
+
- Latest *release* and *snapshot* builds available
|
|
13
|
+
- Automatic sudo escalation for privileged installation directory
|
|
18
14
|
- Automatic operating system and machine architecture detection
|
|
19
15
|
|
|
20
16
|
# Installation
|
|
@@ -36,7 +32,7 @@ ffup <install|update [--dry-run]|check|uninstall> [OPTIONS] [ffmpeg] [ffprobe] [
|
|
|
36
32
|
Alternatively, can be invoked as a module with `python -m ffmpeg_update <COMMAND>`.
|
|
37
33
|
|
|
38
34
|
> [!TIP]
|
|
39
|
-
> Multiple names can be passed, e.g
|
|
35
|
+
> Multiple names can be passed, e.g., `ffup install ffmpeg ffprobe`
|
|
40
36
|
|
|
41
37
|
> [!NOTE]
|
|
42
38
|
> Default is `ffmpeg`, if no name is passed
|
|
@@ -44,32 +40,32 @@ Alternatively, can be invoked as a module with `python -m ffmpeg_update <COMMAND
|
|
|
44
40
|
## Parameters
|
|
45
41
|
|
|
46
42
|
- `--dir`: The path to the installation directory
|
|
47
|
-
- Environment variable: `$FFUP_DIR`/`$XDG_BIN_HOME`
|
|
48
43
|
- Default: `~/.local/bin`
|
|
49
|
-
-
|
|
44
|
+
- Environment variable: `$FFUP_DIR`, `$XDG_BIN_HOME`
|
|
45
|
+
- Commands: `check`, `install`, `uninstall`, `update`
|
|
50
46
|
|
|
51
47
|
- `--build`: The build type
|
|
48
|
+
- Default: `snapshot`
|
|
52
49
|
- Choices: `release`, `snapshot`
|
|
53
50
|
- Environment Variable: `$FFUP_BUILD`
|
|
54
|
-
-
|
|
55
|
-
- Functions: `check`, `install`, `update`
|
|
51
|
+
- Commands: `check`, `install`, `update`
|
|
56
52
|
|
|
57
53
|
- `--arch`: The machine architecture
|
|
54
|
+
- Default: Auto-detect using `platform.machine()`
|
|
58
55
|
- Choices: `amd64`, `arm64`
|
|
59
56
|
- Environment Variable: `$FFUP_ARCH`
|
|
60
|
-
-
|
|
61
|
-
- Functions: `check`, `install`, `update`
|
|
57
|
+
- Commands: `check`, `install`, `update`
|
|
62
58
|
|
|
63
59
|
- `--os`: The operating system
|
|
60
|
+
- Default: Auto-detect using `platform.system()`
|
|
64
61
|
- Choices: `linux`, `macos`
|
|
65
62
|
- Environment Variable: `$FFUP_OS`
|
|
66
|
-
-
|
|
67
|
-
- Functions: `check`, `install`, `update`
|
|
63
|
+
- Commands: `check`, `install`, `update`
|
|
68
64
|
|
|
69
65
|
- `--dry-run`: A flag to skip download/install, and only check for updates
|
|
70
|
-
- `ffup check` is an alias for `ffup update --dry-run`
|
|
71
66
|
- Default: `False`
|
|
72
|
-
-
|
|
67
|
+
- Commands: `update`
|
|
68
|
+
- Note: `ffup check` is an alias for `ffup update --dry-run`
|
|
73
69
|
|
|
74
70
|
# API Reference
|
|
75
71
|
|
|
@@ -98,21 +94,3 @@ Alternatively, can be invoked as a module with `python -m ffmpeg_update <COMMAND
|
|
|
98
94
|
> - `build`: `"release"`, `"snapshot"`
|
|
99
95
|
> - `arch`: `"amd64"`, `"arm64"`
|
|
100
96
|
> - `os`: `"linux"`, `"macos"`
|
|
101
|
-
|
|
102
|
-
# Error Handling
|
|
103
|
-
|
|
104
|
-
## `FileNotFoundError`
|
|
105
|
-
|
|
106
|
-
- By design, all operations will fail if the path in question does not exist
|
|
107
|
-
- For new installations, ensure that the installation directory exists
|
|
108
|
-
- For other operations, ensure that the path points to the installed binary
|
|
109
|
-
|
|
110
|
-
## `HTTPError`
|
|
111
|
-
|
|
112
|
-
- `404 Client Error: Not Found for url: ...`
|
|
113
|
-
- Caused by invalid values for one or more of `build`, `arch`, and `os` parameters
|
|
114
|
-
|
|
115
|
-
## `PermissionError`
|
|
116
|
-
|
|
117
|
-
- Triggers automatic escalation via `sudo`
|
|
118
|
-
- The user is prompted for a password at `stdin`
|
|
@@ -73,21 +73,20 @@ async def update(
|
|
|
73
73
|
progress: Annotated[Progress, Parameter(parse=False)],
|
|
74
74
|
client: Annotated[AsyncSession, Parameter(parse=False)],
|
|
75
75
|
) -> None:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
)
|
|
76
|
+
bin_lst = list(bins)
|
|
77
|
+
latest, *current_lst = await asyncio.gather(
|
|
78
|
+
_latest("ffmpeg", client), *[_current(dir / bin) for bin in bin_lst]
|
|
79
|
+
)
|
|
80
|
+
print(f"Latest Version: {latest}")
|
|
81
|
+
for bin, current in zip(bin_lst, current_lst):
|
|
82
|
+
if current != latest:
|
|
83
|
+
print(f"{_fmt_FF(bin)}: update available")
|
|
84
|
+
else:
|
|
85
|
+
bins.remove(bin)
|
|
86
|
+
print(f"{_fmt_FF(bin)}: up to date")
|
|
87
|
+
|
|
88
|
+
if not dry_run and bins:
|
|
89
|
+
await install(bins, dir=dir, tempdir=tempdir, progress=progress, client=client)
|
|
91
90
|
|
|
92
91
|
|
|
93
92
|
@app.command
|
|
@@ -159,11 +158,14 @@ def get_os() -> OSType:
|
|
|
159
158
|
raise RuntimeError(f"unsupported operating system '{os}'")
|
|
160
159
|
|
|
161
160
|
|
|
162
|
-
def _current(path):
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
async def _current(path):
|
|
162
|
+
process = await asyncio.create_subprocess_exec(
|
|
163
|
+
path, "-version", stdout=asyncio.subprocess.PIPE
|
|
164
|
+
)
|
|
165
|
+
stdout, _ = await process.communicate()
|
|
166
|
+
match = re.search(r"version (N-\d+-\w+|\d\.\d(\.\d)?)", stdout.decode())
|
|
165
167
|
if match is None:
|
|
166
|
-
raise ValueError(f"failed to parse version from `{path} -version`
|
|
168
|
+
raise ValueError(f"failed to parse version from `{path} -version`")
|
|
167
169
|
return match.group(1)
|
|
168
170
|
|
|
169
171
|
|
|
@@ -172,7 +174,7 @@ async def _latest(bin, client):
|
|
|
172
174
|
response.raise_for_status()
|
|
173
175
|
match = re.search(r"_(N-\d+-\w+|\d\.\d(\.\d)?)", response.headers["location"])
|
|
174
176
|
if match is None:
|
|
175
|
-
raise ValueError("failed to parse version from
|
|
177
|
+
raise ValueError(f"failed to parse version from {response}")
|
|
176
178
|
return match.group(1)
|
|
177
179
|
|
|
178
180
|
|
|
File without changes
|
|
File without changes
|