Skip to content

Expose post-3.49-2 engine options in the GUI#31

Merged
xroche merged 7 commits into
masterfrom
feature/gui-expose-engine-3.49-options
Jul 15, 2026
Merged

Expose post-3.49-2 engine options in the GUI#31
xroche merged 7 commits into
masterfrom
feature/gui-expose-engine-3.49-options

Conversation

@xroche

@xroche xroche commented Jul 15, 2026

Copy link
Copy Markdown
Owner

What

Adds GUI controls for the user-facing options the engine gained since 3.49-2, plus a
stale-default fix. Six commits, one per concern:

  • SOCKS5 proxy — a "Proxy type" (HTTP / SOCKS5) dropdown in the proxy Configure
    dialog. Reuses the single proxy address/port/auth; the shell prepends socks5:// to
    the -P argument. Persists as ProxyType.
  • --cookies-file — "Load cookies from file" path field on the Spider tab.
  • --pause — "Pause between files" (MIN[:MAX] seconds) field on the Flow Control tab.
  • URL-hack opt-outs — three checkboxes on the Links tab emitting --keep-www-prefix,
    --keep-double-slashes, --keep-query-order.
  • --strip-query — "Strip query keys" field on the Experts tab.
  • User-Agent — new-project default changed from Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98) to Mozilla/5.0 (compatible; HTTrack; +https://www.httrack.com/).

Why

These options were unreachable from the GUI, forcing users onto a hand-edited command
line. The UA default was a 1998 fabricated string that overrode the engine's modern
honest identifier on every new project. Closes #30.

How

Each option follows the same seam: a control on its OptionTabN (+ resource.h id and
WinHTTrack.rc dialog entry), a member with DDX, a CShellOptions field set in
compute_options() and emitted in lance(), and save/load in both Write_profile
branches + Read_profile. All toggles/fields default off/empty, so the emitted command
line is unchanged for existing projects. Value options are emitted as their documented
long flags; the SOCKS scheme is prepended to the existing -P string.

New labels/tooltips reference new LANG_* keys (defined in cpp_lang.h). Their
translated values are added engine-side in lang.def + lang/*.txt (they ship from the
engine checkout via CI); English display is covered by the .rc captions until then, and
other languages fall back to English — no blank-label regression for English users.

Built and validated by CI (no local MFC toolchain); the change is mechanical and split
per feature so any single item can be reverted independently.

Not included

--why (-%Y) is a diagnose-and-exit filter check rather than a mirror setting; left for
a future "test a URL against the rules" button. webhttrack parity and the engine-side
lang.def/translation additions are handed off separately.

🤖 Generated with Claude Code

xroche and others added 7 commits July 15, 2026 15:27
The GUI shipped a 1998 default UA string, "Mozilla/4.5 (compatible;
HTTrack 3.0x; Windows 98)", and emitted it via -F for every new project,
overriding the engine's own default. The engine (3.49-11) now defaults to
an honest crawler identity, so align the GUI's new-project default with it.

Only affects fresh projects; existing profiles keep their saved UserID.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The engine (3.49-8+) accepts a scheme-prefixed proxy argument,
-P socks5://[user:pass@]host[:port], and tunnels both HTTP and HTTPS
origins through it automatically. The GUI had no way to select it.

Add a "Proxy type" dropdown (HTTP / SOCKS5) to the advanced proxy
Configure dialog, reusing the single existing proxy address/port/auth
fields. The selection round-trips through COptionTab10::m_proxytype,
persists as the ProxyType profile key, and the shell prepends the
socks5:// scheme to the -P argument. HTTP stays the default, so the
emitted command line is unchanged for existing projects.

New LANG keys (LANG_PROXYTYPE, LANG_PROXYTYPETIP) are wired here; their
translations are added engine-side in lang.def/lang/*.txt (see hand-over
note). English display is covered by the .rc caption meanwhile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The engine (3.49-10) can preload a Netscape cookies.txt before crawling.
Add a "Load cookies from file" path field to the Spider tab, persist it
as the CookiesFile profile key, and emit --cookies-file <path> when set.

LANG keys LANG_COOKIEFILE / LANG_COOKIEFILETIP are wired; translations
follow engine-side (hand-over note).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The engine (3.49-10) can space out downloads by a random per-file delay.
Add a "Pause between files" field (MIN[:MAX] seconds) to the Flow Control
tab, persist it as PauseFiles, and emit --pause <value> when set. This is
distinct from the pre-existing -G pause-after-N-bytes throttle on Limits.

LANG keys LANG_PAUSEFILES / LANG_PAUSEFILESTIP wired; translations follow
engine-side.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The engine (3.49-10) split the -%u URL-hack into independently
disableable parts. Add three checkboxes to the Links tab
(keep www. prefix / keep double slashes / keep query order) that emit
--keep-www-prefix, --keep-double-slashes and --keep-query-order, persisted
as KeepWww / KeepSlashes / KeepQueryOrder. All default off, so the emitted
command line is unchanged unless the user opts out.

LANG keys and tooltips wired; translations follow engine-side.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The engine (3.49-10) can drop selected query-string keys from the dedup
naming. Add a "Strip query keys" field to the Experts tab, persist it as
StripQuery, and emit --strip-query <keys> when set.

LANG keys LANG_STRIPQUERY / LANG_STRIPQUERYTIP wired; translations follow
engine-side.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…bels

Follow-up to the option-exposure work, from GUI review:
- Add a "..." Browse button next to the cookies-file field that opens a
  file picker (CFileDialog), reusing the existing filter idiom.
- Label the pause field "Pause between files (s):" to disambiguate it from
  the pre-existing byte-based "Pause after downloading .. B" on Limits.
- Give the strip-query field an inline example, "Strip query keys
  (e.g. sid,ref):", since its tooltip is not yet available.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
xroche added a commit to xroche/httrack that referenced this pull request Jul 15, 2026
The web GUI was frozen before the engine gained SOCKS5 proxying, --cookies-file,
--pause, --strip-query, and the three --keep-* URL-hack opt-outs. Wire each into
the option tabs, the generated httrack command, the winprofile.ini persistence,
and the reload remap so they reach parity with WinHTTrack (xroche/httrack-windows#31).

The SOCKS5 selector reuses the single proxy field and prepends socks5:// to -P;
it is gated on a non-empty host so a SOCKS5-selected-but-blank config can't emit a
stray scheme token. winprofile.ini key names match WinHTTrack so projects round-trip
across both GUIs. Labels/tooltips reuse the LANG_ strings already added in #588.

Signed-off-by: Xavier Roche <roche@httrack.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@xroche
xroche merged commit a546e4d into master Jul 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose post-3.49-2 engine options in the WinHTTrack GUI

1 participant