Skip to content

options: expose SOCKS5, cookies-file, pause, strip-query, keep-* and a modern User-Agent#36

Merged
xroche merged 1 commit into
masterfrom
feat/expose-engine-options
Jul 21, 2026
Merged

options: expose SOCKS5, cookies-file, pause, strip-query, keep-* and a modern User-Agent#36
xroche merged 1 commit into
masterfrom
feat/expose-engine-options

Conversation

@xroche

@xroche xroche commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Surfaces the crawl options the HTTrack engine picked up between 3.49-3 and 3.49-12, which the Android GUI predates, so it lines up again with WinHTTrack (xroche/httrack-windows#31). The proxy panel gets an HTTP/SOCKS5 selector that prepends socks5:// to the single -P value and defaults to the SOCKS port 1080. The spider panel gets a cookies-file field, flow control a random --pause in MIN:MAX seconds, the expert panel --strip-query, and the links panel the three keep-* toggles that opt out of parts of the -%u URL hack.

It also drops the hardcoded Mozilla/4.5 ... Windows 98 User-Agent default. The browser-identity field now starts empty, so no -F is passed and the engine fills in its own current versioned token unless the user sets one.

A JUnit test covers the new argv emission: the SOCKS5 scheme and port default, the value tokens, the %-flag bundling, and the empty-skip that the User-Agent change relies on. There's no instrumentation suite in this repo, so the widgets themselves are compile-verified only, not device-tested.

Closes #6

…a modern UA

Surface the crawl options the engine gained between 3.49-3 and 3.49-12 in the
Android options UI, keeping parity with the WinHTTrack set (xroche/httrack-windows#31):

- Proxy: an HTTP/SOCKS5 selector that prepends socks5:// to the single -P value
  and defaults to the SOCKS port 1080 instead of 8080.
- Spider: --cookies-file (-%K), a Netscape cookies.txt to preload.
- Flow control: --pause (-%G), a random MIN:MAX-second delay between downloads.
- Expert: --strip-query (-%g).
- Links: the --keep-www-prefix / --keep-double-slashes / --keep-query-order
  toggles that opt out of parts of the -%u URL hack.
- Browser ID: drop the hardcoded "Windows 98" User-Agent default. The field now
  starts empty, so no -F is emitted unless the user sets one and the engine
  applies its own current versioned token.

Adds a JUnit test over the new argv emission: the SOCKS5 scheme and port
default, the value tokens, the %-flag bundling, and the empty-skip that makes
the User-Agent suppression work.

Closes #6

Signed-off-by: Xavier Roche <roche@httrack.com>
@xroche
xroche merged commit 2d82bd7 into master Jul 21, 2026
5 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 Android GUI (SOCKS5, cookies-file, pause, keep-*, strip-query, UA)

1 participant