Skip to content

feat: --scan-ext to scan for any file type, with multi-select#18

Merged
xAlcahest merged 1 commit into
masterfrom
feat/scan-ext-filter
Jun 21, 2026
Merged

feat: --scan-ext to scan for any file type, with multi-select#18
xAlcahest merged 1 commit into
masterfrom
feat/scan-ext-filter

Conversation

@xAlcahest

Copy link
Copy Markdown
Contributor

Summary

--extract-scan only looked for streaming video. Now it scans for video and audio by default, and --scan-ext=iso,zip,mkv,flac (any extensions, any type) restricts the scan to those file types instead, which also covers a plain directory listing (Apache/nginx autoindex). The extension set is threaded through scan_page into classify_url and the URL-capture regexes are built dynamically from it. When a page yields more than one matching file, run_extract_scan opens a multi-select TUI (reusing tui_select_many) so the user picks which files go into the generated config; a deselected subset is captured as an alternation of the raw page refs so it still resolves on a relative-href listing. The download command flux <url> is unchanged and gains no scanning.

A directory-listing config is matched by its landing directory with an optional :port, so the generated config actually re-attaches to the page it came from.

Changes

  • src/scan.c: classify_url takes the active extension set (default widened to video + audio + HLS, custom set matches only the given extensions, any type); dynamic bare-URL and href/src capture regexes built from that set and regcomp-verified; an extension-list series emits a list config keyed by extension; partial multi-select emits an alternation of the raw captured refs; reject candidates containing control characters.
  • src/scan.h: extension-set params on scan_page; raw_ref on the candidate.
  • src/text.c: --scan-ext flag (comma list, validated, rejects non-alphanumeric tokens and empty/trailing segments, only with --extract-scan); multi-select TUI in run_extract_scan; directory-derived match with optional port.
  • src/test_scan.c: audio-default, --scan-ext directory-listing, partial-selection roundtrip, control-char, and ext-token validation cases.
  • README.md, NEWS: document --scan-ext and the multi-select.

@xAlcahest xAlcahest merged commit 7302145 into master Jun 21, 2026
5 checks passed
@xAlcahest xAlcahest deleted the feat/scan-ext-filter branch June 21, 2026 09:56
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.

1 participant