Repository navigation
feat: Add regex URI Rules engine, cloud share link rewrites, Video Players toggle & UI enhancements - #1
feat: Add regex URI Rules engine, cloud share link rewrites, Video Players toggle & UI enhancements#1Bluscream wants to merge 138 commits into
Conversation
…me, and live Test URL matcher
…ation and window exit
…n on YouTube button
…single Tools card
…h is not found to prevent error popup dialog
… missing VRChat yt-dlp log level to Warning
…me video requests
…VirtualFilmInstitute direct bypasses
…ox & Google Drive share URL rewrites
…fox extension data_collection_permissions
…ction_permissions
…d of legacy hardcoded checks
…th RuleEngine action evaluation
… note to Rules tab
…REPORT.txt generation
…n across all 11 languages
…attern / URL') across all languages
…ew UI keys strictly into dedicated bottom section
…cked URLs to rules, and remove legacy BlockedUrls section from SettingsView
…modal prompt before resetting rules
…set confirmation and remove redundant ConfirmUnsavedWindow
…back and add CORS OPTIONS routes
…tering Linux LD_PRELOAD warnings
…ened
The Linux path could not work and said it did. `ss -t -K` needs CAP_NET_ADMIN;
without it the kernel refuses, ss writes "SOCK_DESTROY answers: Operation not
permitted" to stderr, prints its column header to stdout, and still exits 0.
TryKillSocketsForIp treated exit-code-0-plus-non-empty-stdout as success, so on
every machine without root it logged "Successfully severed N active video
connection targets" while changing nothing. Verified against a live socket: the
connection survives untouched.
Windows has the same shape — SetTcpEntry returns ERROR_ACCESS_DENIED without
elevation, and that was logged at Debug, so it also failed silently.
Reworked around the distinction that actually matters:
Local — a cached video streaming from our own web server. We own that
socket, so closing it always works, everywhere, unprivileged.
Remote — VRChat talking to a CDN directly. Privileged, and therefore usually
impossible.
Severing now returns a SeverResult carrying both counts and a SeverOutcome
(Severed / NotPermitted / Unsupported / NothingToDo / Failed), classified from
what actually happened: stderr for the permission refusal, and socket rows
printed beneath ss's header for real closures. The UI and the log say
"this needs administrator/root, a video already streaming will keep playing"
instead of claiming victory.
SocketKill is split into NetworkConnections (read-only listing, safe) and
ConnectionSevering (privileged, destructive) — keeping them together made it
easy to assume that seeing a connection meant being able to close it.
Also in this pass:
- Dropped the silent `sudo -n ss -K` escalation. Attempting to run as root
without ever telling the user is not something to do behind their back; the
message now explains the requirement so they can choose to elevate.
- Subprocesses go through ProcessRunner instead of ReadToEnd-then-WaitForExit,
the deadlock shape that runner exists to prevent, and severing is async so it
no longer blocks the UI thread on two process launches per address.
- Severing one CDN address no longer calls CloseAllLocalStreams and take every
other playing video down with it.
- procfs parsing returns failure instead of "127.0.0.1" for anything it cannot
parse — a real address that would then be matched and severed — and now reads
/proc/net/tcp6, so IPv6 streams are at least visible.
- Process matching is exact ("VRChat") rather than a substring, and the result
is cached briefly instead of enumerating every process on the machine per
refresh.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ated The first-run notice said "Your previous settings have been kept as a backup in PlusConfig.json.bak". Migrations were deliberately removed, so nothing writes a .bak anywhere — users following that advice would go looking for a file that does not exist. What actually happens is simpler: the old PlusConfig.json is left exactly where it is, unread. The notice now says that, and also names the Plus version alongside the original as something that will rewrite the file. A test asserted the ".bak" string, so it was enforcing the incorrect text rather than catching it; it now asserts the real filename and that no backup is mentioned. Adds a locale key-parity test, which immediately found ko.loc.json missing CookiesRefreshHeader. English is the fallback so it degraded quietly, which is exactly why it went unnoticed — the key is now present and drift fails the build. Also corrects two comments left describing the removed migration, in ConfigManager and DefaultRules. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A failing YouTube video could launch yt-dlp four times: the AVPro attempt, the
non-AVPro retry, the android-client fallback, and ApiController's own retry
after the prefetch fails. Each launch is a ~15 MB Python bundle with a second or
two of startup, and VRChat is blocked on the resolve throughout. For a deleted,
private or members-only video, not one of them could ever have succeeded.
The retries themselves are worth keeping — the android fallback genuinely
rescues restricted DASH formats, and a cookie-less retry rescues expired
cookies — so rather than removing them, they are now gated on
IsTerminalFailure. Format errors and bot checks stay retryable (a different
player client can beat both); "Video unavailable", "Private video",
"members-only", "has been terminated" and friends return immediately.
Also moves the oEmbed lookup below the cache check in
FetchAndCacheYouTubeMetadataAsync. It ran first, so every call made an HTTP
round trip to YouTube even when the duration was already cached and the method
was about to return without doing anything. Its bare `catch {}` is gone too —
GetVideoTitleAsync already logs its own failures, which that swallowed.
Sixteen tests cover the classifier in both directions.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…-aware log monitor Three fixes to connection severing and one to the log monitor. IPv6 on Linux: `ss` parses its own address filter, and a bare IPv6 literal loses — the colons read as a host:port separator, so `dst 2001:db8::1` is rejected with "an inet prefix is expected rather than 2001:db8:" and nothing is closed. Verified against a live `ss` that `dst [2001:db8::1]` parses and a bare literal does not. Brackets are all that was missing; SOCK_DESTROY itself is address-family agnostic. IPv6 on Windows: there is no fix. Windows exposes MIB_TCP6ROW for listing IPv6 connections but has never shipped a SetTcp6Entry to close one, at any privilege level. Previously those targets were silently skipped and folded into the same "not permitted" bucket as an unelevated IPv4 attempt, which would now offer an elevation prompt that cannot possibly help. They are split out and reported as Unsupported instead — while an IPv4 sever that did work still reports Severed. Elevation: ElevatorManager already knew how to re-run us as root through pkexec (falling back to sudo with a graphical askpass, then a terminal), which is how the hosts entry is edited. That is generalised into RunElevatedSelfAsync and reused here via a new --sever-connections=<ip>,<ip> one-shot command, so on KDE the password prompt is polkit's own agent and the password never enters this process. The helper re-parses every address as an IPAddress and drops anything else before it reaches `ss`, since that code path runs as root. Elevation is opt-in per call site: the explicit "sever this connection" buttons pass allowElevation, the automatic block-all-videos toggle does not — a polkit or UAC dialog nobody asked for, mid-session, is worse than a video that finishes. Users who would rather never be prompted can grant the capability once instead; CapabilityHint spells out the setcap cap_net_admin+ep line and is surfaced in the log whenever the kernel refuses. VrcLogMonitor now links its token to Program.ShutdownToken like the other background loops, so it unwinds on shutdown rather than being killed mid-read by the Environment.Exit at the end of Main. Adds 6 tests (208 total).
English is the localization fallback, which is precisely why translation problems
never surface: a missing key silently renders English, an empty one silently
renders nothing, and a key nobody references any more just sits there being
translated into eight languages forever. scripts/lint-locales.py makes all of it
fatal — missing, unexpected, empty, untranslated and unused keys — and is wired
into both build.sh --lint and CI. Each of the five checks was verified to fail the
build by breaking a locale file on purpose and confirming the exit code.
It is Python rather than shell because every check needs real JSON parsing and the
build cannot assume `jq` is installed.
Two escape hatches, kept apart on purpose. locale-allow-identical.txt is for values
that are legitimately the same everywhere (Chrome, Firefox, the product name).
locale-untranslated.txt is debt, listed as lang:Key, so new untranslated strings
fail while existing ones do not block; the linter also fails on a *stale* entry, so
finishing a translation forces its line to be deleted and the file can only shrink.
The current debt is 55 strings, all Italian.
Unused-key detection deliberately matches whole words over the whole source rather
than Localizer.Get("Key") alone: keys are produced in one place and resolved in
another — VideoDownloader returns a bare "SkipReasonBotCheck" and VideoId builds
"SkipReasonTooLong|{0:F0}|{1}" — and a precise pattern called all of those dead.
Erring towards "used" is the right direction; a dead-key report you cannot trust is
worse than one that occasionally misses something. That found 10 genuinely dead
keys (MessageOfTheDay, JoinOurDiscord, the per-platform cache toggles superseded by
rules, and others), now removed from all eight files.
build.sh gains --bump --lint --build --deploy --commit --push --release, plus --all
and --dry-run. They run in dependency order no matter what order they are passed,
any failure aborts the rest, and every dotnet invocation now carries -warnaserror.
--restart no longer implies a deploy. Under the obvious rule — "no action flags
selected, so fall back to the legacy build+deploy" — `./build.sh --restart` selected
nothing, fell through, and silently built, deployed and restarted the running app.
The legacy default is now keyed on there being no arguments at all, and --restart
without --deploy is refused outright: a modifier must not be able to become a deploy
on its own.
AGENTS.md collects the things that have gone wrong here more than once: the shared config that upstream VRCVideoCacher strips keys out of, localization that fails silently because English is the fallback, source-generated JSON that fails at runtime rather than compile time, `ss -K` exiting 0 when it did nothing, .NET refusing an HTTPS→HTTP redirect, loops that never linked Program.ShutdownToken, ArgumentList vs Arguments for paths with spaces, TimeSpan normalizing instead of throwing, and the yt-dlp-stub.exe that rebuilds non-deterministically and shows up dirty every time. Plus the build/lint/release commands, and the style and UX rules this fork shares with upstream so the two stay readable as one project. --restart is gone. It killed whatever was running, relaunched through Steam and inferred success from a five-second sleep — too blunt for something you generally want to watch, and the flag was a hazard in its own right: it selected no action, so it fell through to the legacy "no actions means build and deploy" default and silently deployed. That fallback is now keyed on the argument count instead, and the help points at `steam steam://rungameid/4296960` for starting the app by hand. The now-unused ANY_ACTION tracking goes with it.
…-restart GitHub Actions does not run on this account, so every push produced a failed run and a notification. .github/workflows/ci.yml now triggers on workflow_dispatch only. It is kept rather than deleted because it still documents what a full check is and is one edit away from working for anyone who forks; the re-enabling snippet is in a comment at the top. Its work moves into build.sh. --lint already covered the build-and-test and browser-extension jobs. The publish job becomes --artifacts, which publishes win-x64 and linux-x64 with -warnaserror and zips them into dist/. That matters beyond packaging: Release is the only configuration that is trimmed and single-file, so it is the only one that exercises the trimmer, and a Debug build cannot reproduce the trimmer dropping something that only reflection reaches. Both RIDs publish clean. --release now attaches those zips and refuses to publish without them, rather than creating a release with no downloads in it — which is what it would have done now that no CI job uploads anything. Running the workflow locally under `act` was the alternative and is not worth it: it wants a container runtime and a runner image to do what is, in the end, two dotnet publish calls. Neither act nor docker is installed here anyway. --stop and --start are new, with --restart as the pair, replacing the --restart that was removed last commit. They sit either side of --deploy in the action order, since you want the app stopped before its files are overwritten and started after. Both are better behaved than the old flag: --stop sends SIGTERM first so the shutdown token fires and the loops unwind, escalating to SIGKILL only after 10s, and --start polls for up to 30s instead of sleeping 5s and declaring a crash — that fixed-sleep guess reported a crash on every slow Steam launch. --stop is explicitly dry-run guarded, or the wait-and-verify would fail on a process it never signalled.
…ment privileges A release is now always the same four downloads: the win-x64 and linux-x64 zips, the Chrome .crx and the Firefox .xpi. --release implies --artifacts so it builds them itself rather than attaching whatever an older run happened to leave in dist/, and --artifacts now packages the browser extensions too instead of only the application. Both check the set is complete rather than trusting it. BrowserExtension/build.sh skips the .crx with a warning when npx is unavailable, which would otherwise produce a release quietly missing the Chrome download; that now aborts. Fixed a collision this exposed: BrowserExtension/build.sh did `rm -rf` on dist/, which is shared with the application artifacts, so whichever of the two ran second deleted the other's output. It now clears only its own files. Exactly the four named assets are attached, not a glob over dist/ — the extension .zip byproducts live there too (the .xpi is a copy of the Firefox zip, the .crx is built from chrome/), and a release listing six downloads where two duplicate two others is just confusing. README gains a section on why an already-playing video sometimes cannot be stopped: closing another process's socket is privileged, `sudo setcap cap_net_admin+ep` grants it once on Linux and must be redone after every update, polkit prompts otherwise, and Windows cannot close IPv6 connections at any privilege level. The setcap line existed only in a log message and in AGENTS.md until now. Also corrects the settings section, which still described a `Plus` key and a PlusConfig.json.bak migration — both removed when the config became a single shared file. The translated READMEs never covered this and needed no change.
The README was three forks of accumulation read as one document: download links to bare VRCVideoCacher.exe/VRCVideoCacher that releases no longer produce, instructions to side-load the extension from a cloned repo folder when every release now ships a .crx and .xpi, a "Steam app integration isn't supported yet" build-status section with a stray unmatched </details>, and the entire FAQ folded away inside a collapsed block labelled as belonging to somebody else's README. Rewritten around what this fork actually is and does. Kept and corrected: how the yt-dlp stub works, the risk answer, config location, the outbound-connection table including the two rewrites that quietly involve a third party, the bot-detection and clock-skew answers, and uninstall steps. Dropped everything describing software this is no longer. Download links now name the assets that exist. The extension section leads with the signed store version and is honest that the PlusPlus one is unsigned and must be side-loaded — release Firefox will not install an unsigned .xpi at all, which the old instructions never said. Platform support says what is actually tested rather than claiming Linux is untested when it is the development platform. Screenshots move to the existing orphan `assets` branch and are referenced by raw URL, so the code history carries no binaries. docs/screenshots is deleted; its three images were the pre-fork UI and are kept on `assets` only because the four translated READMEs still link them — those now point at the branch too. Added a note that the translations are inherited and describe the original VRCVideoCacher, which is true and was not stated anywhere.
…se commits
Tags here are bare versions (2026.8.21) while release titles carry the v
(v2026.8.21). build.sh tagged v${VERSION}, which would have created v2026.8.22
alongside 2026.8.21 and split the tag history in two. Both conventions are now
followed: TAG is bare, RELEASE_TITLE has the v, and the default commit message uses
the title.
--commit also does `git add -A`, so the yt-dlp-stub.exe that rebuilds
non-deterministically — identical content, different bytes — would land in every
release commit. It is now restored before committing, but only when it was already
clean at the start of the run, so a genuine change to the stub is never discarded.
`gh release create` creates a draft, uploads the assets, then publishes. A 100MB upload is not quick, and interrupting it leaves a published-looking draft behind with no assets — which is exactly what happened releasing 2026.8.22, and had to be finished by hand. The old "release already exists" guard made that unrecoverable: every retry saw the draft, refused, and offered nothing to do about it. It now distinguishes the two cases, resuming a draft with `gh release upload --clobber` followed by `gh release edit --draft=false`, and only refusing when the release is genuinely published. It also verifies afterwards that every asset reached the "uploaded" state. gh exits before GitHub finishes processing large files, and an asset stuck in "starting" is a broken download link on a release that otherwise looks fine.
|
I'll review this pr soon, comment if you need something! |
|
re: Extension key AI response
We've already generated a replacement and stored it as a GitHub Actions secret on this repo, To pick it up:
Tested this locally: crx3 signs fine with a key that's never touched git, and two builds from the same key produce a byte-identical .crx, so the ID-stability goal you were going for still holds. |
Inital review from AI
Reviewed this in depth — the direction is right. Replacing the per-site booleans with one regex rule engine (Cache/Block/Redirect/Rewrite/Direct) is a real architectural improvement, and the Rewrite-then-rechain design for cloud share links (Dropbox, Google Drive) is a clean way to fold link normalization into the same mechanism instead of bolting it on separately. It's not there yet, though. The main gap: the engine is only enforced in Things that need fixing before this is mergeable:
Non-blocking: None of these are architecture-level objections — they're gaps in wiring the new engine through consistently and migrating existing configs onto it. Given the scope (147 files, 100 commits), do you want to keep working on this over the next month? I might tuck the regex Rules checklist inside or below the settings tab too. |
Packages chrome/ and firefox/ into dist/, and guards against the two failure modes the separate load-unpacked targets invite: the shared files drifting apart, and the two manifests disagreeing about the version. Ported by file rather than by commit: on the PR it arrived split across fda80c7, 30c5ae8, b0741ba and 05c0b59, and the other three also rewrite the fork's README, AGENTS.md and build.sh, none of which are wanted here. Co-authored-by: Bluscream <bluscream@users.noreply.github.com>
PR #1 by Bluscream, curated from 138 commits to 111: the regex URI rules engine and its Rules tab, rule enforcement at every point a URL enters, the site-integration refactor, the Video Players toggle with connection severing, the VRChat log monitor with the Now Playing card and Active Connections grid, the smaller UI work, and the upstream-quality fixes and hardening. Dropped: the fork's build/release plumbing and binaries, and the message-of-the-day banner, which this fork does not ship.
PR #1 by Bluscream, curated from 138 commits to 111: the regex URI rules engine and its Rules tab, rule enforcement at every point a URL enters, the site-integration refactor, the Video Players toggle with connection severing, the VRChat log monitor with the Now Playing card and Active Connections grid, the smaller UI work, and the upstream-quality fixes and hardening. Dropped: the fork's build/release plumbing and binaries, and the message-of-the-day banner, which this fork does not ship.
|
Thanks! |
|
i have added a notice box to my fork that its features are almost all upstream now, so theres not much need for it anymore, and i archived it, if theres anything that needs my input, just ping me ! |
Summary of Enhancements
This Pull Request brings several major feature enhancements ported and expanded from the VRCVideoCacher ecosystem:
📷 Screenshots & Release Artifacts: https://github.com/Bluscream/VRCVideoCacherPlusPlus/releases/tag/2026.8.20
⚡ Regex URI Rules Engine & Live Matcher UI
Cache,Redirect,Rewrite,Block, andDirectactions.$1,$2) and token expansions.🔀
RewriteAction & Cloud Share Direct Link RewritesRewriterule action type which transforms URLs (such as cloud share links) while allowing lower rules down the chain to evaluate the rewritten URL.dl=0->dl=1/file/d/<id>/view->uc?export=download&id=<id>🎬 In-Game Video Player Toggle
🛠️ Dashboard & UI Improvements
yt-dlp,Deno, andFFmpegruntimes (Up-To-Date,Shim,Outdated,Missing).Watch Video,Copy File Path,Open on YouTube,Open Source URL,Delete).data_collection_permissionsinmanifest.jsonfor AMO compatibility.