mirror of
https://github.com/andwati/kget-capture.git
synced 2026-10-23 13:32:20 +00:00
Chrome requires manifest.json at the zip root for Web Store submission and manual unpacked loading. The whole-repo git archive added for the native-host installer buried it under extension/, so publish both: a manifest-at-root extension zip and the full-repo source zip.
161 lines
6.2 KiB
Markdown
161 lines
6.2 KiB
Markdown
# KGet Capture
|
|
|
|
A Chromium browser extension that sends downloads to
|
|
[KGet](https://apps.kde.org/kget/), KDE's download manager, instead of the
|
|
browser's built-in downloader.
|
|
|
|
- Right-click a link/image/video/audio and choose **"Download with KGet"**.
|
|
- Or toggle **auto-capture** from the toolbar so every download is handed off
|
|
automatically, with the correct filename.
|
|
- A desktop notification fires when a capture finishes downloading.
|
|
|
|
## Requirements
|
|
|
|
- Linux with KGet installed and running (or set to autostart)
|
|
- A Chromium-based browser: Chrome, Chromium, Brave, Vivaldi, or Edge
|
|
- `python3`, `dbus-send`
|
|
- `notify-send`, optional, for the completion notification
|
|
- `kwriteconfig6` (KDE Frameworks), optional, silences KGet's own duplicate
|
|
notification
|
|
|
|
Install everything on your distro:
|
|
|
|
**Fedora**
|
|
```bash
|
|
sudo dnf install kget python3 dbus-tools libnotify kf6-kconfig
|
|
```
|
|
|
|
**Arch / Manjaro**
|
|
```bash
|
|
sudo pacman -S kget python dbus libnotify kconfig
|
|
```
|
|
|
|
**Debian / Ubuntu / KDE neon**
|
|
```bash
|
|
sudo apt install kget python3 dbus-bin libnotify-bin kf6-kconfig-bin
|
|
```
|
|
|
|
**openSUSE**
|
|
```bash
|
|
sudo zypper install kget python3 dbus-1 libnotify-tools kconfig-tools
|
|
```
|
|
|
|
(`notify-send` and `kwriteconfig6` package names shift around between distro
|
|
versions. If a command above fails, drop that one package and search your
|
|
package manager for the binary name instead. Everything else still works
|
|
without them.)
|
|
|
|
## Install
|
|
|
|
1. Install the extension from the Chrome Web Store: **`<CHROME_WEB_STORE_URL>`**
|
|
*(placeholder, fill in once the listing is live)*.
|
|
2. Install the native messaging host that lets the extension talk to KGet.
|
|
Download and extract `kget-capture-vX.Y.Z.zip` (the source archive, not
|
|
`kget-capture-extension-vX.Y.Z.zip`) from the
|
|
[Releases page](https://github.com/andwati/kget-capture/releases), then
|
|
from inside that folder:
|
|
```bash
|
|
./install.sh
|
|
```
|
|
3. Open your browser's download settings (`chrome://settings/downloads`,
|
|
`brave://settings/downloads`, etc.) and turn **off** "Ask where to save
|
|
each file before downloading". Chrome shows this dialog itself, before the
|
|
extension gets a chance to intercept the download, so this one-time change
|
|
is required.
|
|
|
|
`install.sh` registers the native host for every supported browser it finds
|
|
installed and prints any remaining setup warnings.
|
|
|
|
### Building from source
|
|
|
|
Contributing, or want to run an unreleased version? Load the extension
|
|
unpacked instead of step 1 above:
|
|
|
|
```bash
|
|
git clone https://github.com/andwati/kget-capture.git
|
|
cd kget-capture
|
|
./install.sh
|
|
```
|
|
|
|
(Or, for an already-tagged version without cloning: download and extract
|
|
`kget-capture-extension-vX.Y.Z.zip` from the
|
|
[Releases page](https://github.com/andwati/kget-capture/releases) instead.
|
|
It's already just `extension/`'s contents, unpacked at the zip root the way
|
|
Chrome expects. You'll still need `kget-capture-vX.Y.Z.zip` for `install.sh`,
|
|
per step 2 above.)
|
|
|
|
Then in `chrome://extensions`: enable **Developer mode**, click **Load
|
|
unpacked**, and select the `extension/` directory (from your clone, or the
|
|
extracted extension zip). `install.sh` prints the extension's fixed ID so
|
|
you can confirm it loaded correctly.
|
|
|
|
## Usage
|
|
|
|
- **On-demand:** right-click a link/image/video/audio → "Download with KGet".
|
|
- **Automatic:** click the toolbar icon and flip "Auto-capture all downloads"
|
|
on or off. The badge shows "ON" (green) or "OFF" (grey).
|
|
|
|
## Uninstall
|
|
|
|
```bash
|
|
./uninstall.sh
|
|
```
|
|
|
|
Removes the native messaging host registrations and installed host script.
|
|
Remove the extension itself via `chrome://extensions` (or the Chrome Web
|
|
Store listing); that step can't be scripted.
|
|
|
|
## Releases
|
|
|
|
Prebuilt releases are published on the
|
|
[Releases page](https://github.com/andwati/kget-capture/releases); each
|
|
`vX.Y.Z` tag push builds and publishes one automatically.
|
|
|
|
## Known limitations
|
|
|
|
- **`blob:`/`data:`/`file:`/`filesystem:` URLs can't be captured.** There's
|
|
no real network URL to hand to KGet, so these proceed normally through
|
|
Chrome.
|
|
- **Auto-capture has a brief head start.** Manifest V3 removed blocking
|
|
`webRequest`, so Chrome begins the download before the extension can cancel
|
|
it. A small/partial temp file may transiently appear before it's erased.
|
|
- **No editable dialog.** Captures start immediately with no chance to
|
|
rename the file or pick a folder beforehand: KGet only skips its
|
|
interactive dialog when given a destination path up front, so instant
|
|
capture and an editable prompt are mutually exclusive.
|
|
- **Chrome may still show its own "Save As" dialog** if you skipped step 3 of
|
|
Install above.
|
|
- **KGet must already be running.** If it's not, captures fail silently;
|
|
check the service worker console for the actual error (see
|
|
Troubleshooting).
|
|
|
|
## Troubleshooting
|
|
|
|
- **Check native host registration:** confirm
|
|
`~/.config/<browser>/NativeMessagingHosts/com.kget_capture.host.json` exists
|
|
and its `path` points at an executable file
|
|
(`~/.local/share/kget-capture/kget_capture_host.py`).
|
|
- **Inspect the extension's logs:** on `chrome://extensions`, find "KGet
|
|
Capture", click "service worker" under "Inspect views" to open its console.
|
|
- **Test D-Bus directly:**
|
|
```bash
|
|
dbus-send --print-reply --dest=org.kde.kget /KGet \
|
|
org.kde.kget.main.addTransfer string:"https://example.com/file.zip" string:"$HOME/Downloads/file.zip" boolean:true
|
|
```
|
|
If this fails with `ServiceUnknown`, KGet isn't running.
|
|
- **Download-complete notification not showing?** Confirm `notify-send` is
|
|
installed (`command -v notify-send`); without it, `kget_capture_host.py`
|
|
skips the notification entirely rather than erroring. Otherwise, check that
|
|
the transfer actually reached 100%: `kget_capture_host.py` polls
|
|
`org.kde.kget.transfer.percent` on the new transfer's D-Bus object path
|
|
(e.g. `/KGet/Transfers/9`, printed by the `addTransfer` call above) until it
|
|
hits 100, so a stuck/erroring transfer never fires one. This notification
|
|
is separate from KGet's own built-in "Download Finished" event.
|
|
`install.sh` disables that one because KGet only fires it for transfers it
|
|
observed in a non-finished state at least once, so it silently skips
|
|
small/fast downloads that complete before that first observation.
|
|
|
|
## License
|
|
|
|
MIT, see [LICENSE](LICENSE).
|