8.3 KiB
rclone-jav — Install Guide
End-to-end setup for a fresh PC. Tested on Windows 11 + Brave Stable. Should also work for Chrome with minor path tweaks.
PC2 / Staging note: Paths below use
D:\DEV\Extensions\Production\rclone-jav\. On the Staging PC, substituteProduction→Stagingthroughout.
Prerequisites
-
Python 3.9+ on PATH. Verify:
python --versionNote the install location (e.g.
C:\Python314\python.exe). Needed in step 6. -
rclone on PATH with your remotes configured (
rclone config). Verify:rclone version rclone lsf <your-remote>: -R --include "*IPZZ*" # sanity checkIf "rclone not found" in a fresh PowerShell despite being installed: Windows Terminal sometimes caches the old PATH across new pwsh sessions. Quick fix for the current session:
$env:Path += ';C:\Programs\rclone' # or wherever rclone.exe lives rclone versionPermanent fix: close Windows Terminal completely (all windows, not just tabs) and reopen — fresh pwsh will inherit the registered user PATH. If still missing, sign out/in once.
-
Brave (Stable, Beta, Dev, or Nightly — install registers all four channels).
-
rich (Python package, used by
rc-jav.py):pip install rich
Step 1 — Place the files
Copy both project folders:
D:\DEV\Project\rclone-jav\ ← rc-jav.py + cache.json + config.json + wincatalog\
D:\DEV\Extensions\Production\rclone-jav\ ← manifest + host\
rcjav-host.bat is now portable — it uses Windows' py launcher or falls back to python on PATH. No per-machine Python path edits needed as long as Python is on PATH.
If you put the project folder elsewhere than D:\DEV\Project\rclone-jav, you'll either:
- Edit the
RC_JAVconstant at the top ofD:\DEV\Extensions\Production\rclone-jav\host\rcjav-host.py, OR - Set it via the extension's Options → Setup & Transfer → rc-jav script path (works without editing files).
Step 2 — Configure rc-jav defaults
Edit D:\DEV\Project\rclone-jav\config.json (create if missing):
{
"default_target": ["cq:personal-files/JAV"],
"default_source": [],
"default_catalog": []
}
Or set interactively:
cd D:\DEV\Project\rclone-jav
python rc-jav.py --target cq:personal-files/JAV --save
Verify:
python rc-jav.py --search IPZZ-860 -q --basic
Should return a hit in ~1–2 seconds.
Step 3 — Load the Brave extension
- Open
brave://extensions. - Toggle Developer mode ON (top-right).
- Click Load unpacked.
- Pick
D:\DEV\Extensions\Production\rclone-jav(the folder containingmanifest.json). - Copy the Extension ID shown on the card. Example:
gnimjpgbgehbefdkdjodcimefdedgeho.
Step 4 — Register the native messaging host
Easiest: double-click D:\DEV\Extensions\Production\rclone-jav\host\register-host.bat. It prompts for the ID and runs the installer.
Or manually in PowerShell (any window — script self-elevates):
cd D:\DEV\Extensions\Production\rclone-jav\host
.\install-host.ps1 -ExtensionId <paste-the-extension-id>
UAC will prompt — click Yes. The script writes:
- Manifest:
D:\DEV\Extensions\Production\rclone-jav\host\com.rcjav.host.json(UTF-8 no BOM) - Registry (HKLM + HKCU):
\Software\BraveSoftware\Brave-Browser\NativeMessagingHosts\com.rcjav.host\Software\Google\Chrome\NativeMessagingHosts\com.rcjav.host\Software\WOW6432Node\Google\Chrome\NativeMessagingHosts\com.rcjav.host\Software\Chromium\NativeMessagingHosts\com.rcjav.host
HKLM is required — Brave on Windows often ignores HKCU. The script writes both as belt-and-suspenders.
Verify registry:
reg query "HKLM\Software\BraveSoftware\Brave-Browser\NativeMessagingHosts\com.rcjav.host"
Should print (Default) REG_SZ D:\DEV\Extensions\Production\rclone-jav\host\com.rcjav.host.json.
Step 5 — Fully restart Brave
Closing windows is not enough. Brave caches NM host registrations at process startup.
Get-Process brave | Stop-Process -Force
Or Task Manager → kill every brave.exe. Then reopen Brave.
Step 6 — Verify
- Click the rclone-jav toolbar icon.
- Popup opens, auto-runs a check on the current tab.
- Click Ping host. Expect green banner:
host ok: 0.1.0.
If green, you're done.
Step 7 — Choose triggers (optional)
Click the gear icon in the popup (or right-click extension → Options) to enable:
- Auto-check every page load
- Auto-check on listed JAV sites (configurable host patterns)
- Toolbar icon popup auto-check
- Right-click context menu
- Keyboard shortcut (default
Alt+J, rebind atbrave://extensions/shortcuts)
Enable any combination.
Troubleshooting
Popup shows "host unreachable" / "Specified native messaging host not found":
- Did UAC prompt complete? Re-run
install-host.ps1. reg query "HKLM\Software\BraveSoftware\Brave-Browser\NativeMessagingHosts\com.rcjav.host"must return the manifest path. If empty: install script failed silently.- Manifest file must exist at the registered path AND be valid JSON AND have no BOM. Check:
python -c "import json; json.load(open(r'D:\DEV\Extensions\Production\rclone-jav\host\com.rcjav.host.json'))"— no error = valid. - Fully kill all
brave.exe, then reopen. allowed_originsin the manifest must match the current extension ID. If you reloaded the extension and the ID changed, re-runinstall-host.ps1.
Popup shows "host error: ...":
- Host launched but Python died. Read
D:\DEV\Extensions\Production\rclone-jav\host\logs\rcjav-host-stderr.log. - Common cause: wrong
python.exepath inrcjav-host.bat, or wrongRC_JAVpath inrcjav-host.py.
Badge stays ?:
- Page title has no JAV ID. Extension regex:
[A-Z]{2,}-?[0-9]{2,5}.
Badge stays !:
- Host returned non-zero exit code. Check
host\logs\rcjav-host-stderr.logandhost\logs\rcjav-host.log.
Search returns no hits but the file exists:
- Cache may be stale. Run
python rc-jav.py --scanto refresh, or pass--quick(extension does this by default).
Brave verbose logging for deep debug:
& "C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe" --enable-logging=stderr --vmodule="*native_messaging*=2" 2>&1 | Tee-Object D:\brave-nm.log
# Click ping in extension, then:
Select-String -Path D:\brave-nm.log -Pattern "native|rcjav|com\.rc" -Context 0,2
Can't find manifest for native messaging host com.rcjav.host = registry not seen → re-run installer + restart Brave.
Uninstall
# Remove registry entries (admin)
$keys = @(
'HKLM:\Software\BraveSoftware\Brave-Browser\NativeMessagingHosts\com.rcjav.host',
'HKLM:\Software\Google\Chrome\NativeMessagingHosts\com.rcjav.host',
'HKLM:\Software\WOW6432Node\Google\Chrome\NativeMessagingHosts\com.rcjav.host',
'HKLM:\Software\Chromium\NativeMessagingHosts\com.rcjav.host',
'HKCU:\Software\BraveSoftware\Brave-Browser\NativeMessagingHosts\com.rcjav.host',
'HKCU:\Software\Google\Chrome\NativeMessagingHosts\com.rcjav.host',
'HKCU:\Software\Chromium\NativeMessagingHosts\com.rcjav.host'
)
foreach ($k in $keys) { Remove-Item -Path $k -Force -ErrorAction SilentlyContinue }
Then remove the extension at brave://extensions, and delete D:\DEV\Extensions\Production\rclone-jav\.
Key gotchas learned the hard way
| Gotcha | Symptom | Fix |
|---|---|---|
| UTF-8 BOM in manifest | "Specified native messaging host not found." | Write file with [System.Text.UTF8Encoding]::new($false) |
| HKCU-only registration | Same error, even with valid manifest | Register HKLM (admin) |
| Buffered Python stdio | Host launches but Brave times out | python -u in .bat |
| Text-mode stdio on Windows | First message corrupts immediately | msvcrt.setmode(..., os.O_BINARY) in host script |
| stderr on stdout | Garbage bytes break length prefix | Redirect stderr to file in .bat |
| Extension reload != Brave restart | Stale NM cache | Kill all brave.exe then reopen |
| Extension ID changes on reload | allowed_origins mismatch | Re-run install-host.ps1 (or register-host.bat) with new ID |
| em-dashes (—) in .ps1 file + Windows PS 5.1 + no BOM | Missing closing '}' parse errors at random lines |
Strip em-dashes (replace with -), or save .ps1 with UTF-8 BOM, or invoke via pwsh instead of powershell.exe |