The complete manual: operator guide and script reference. Master v9 (2026-11-25).
One manual for the ISE search mod on drugs-and-users.org and for every script and tool around it. It replaces ISE_Python_Scripts_Manual.md and every separate per-script manual and manual entry. ISE_help.html stays separate, because it is the in-app help for forum users (Β§8).
Part 1 β Operator guide
#do-not-index tag/help)Part 2 β Script reference
Part 3 β Tools
Part 4 β Reference
ISE adds five search sources to SMF's CustomSearch dropdown:
| Source | What it searches | Built by |
|---|---|---|
| ISE | Post bodies and subjects across the whole forum, through ISE's own word index (not SMF's built-in search) | IndexBuilder.py |
| ISEpdf | Text extracted from PDF attachments, plus each PDF's filename and its topic's subject. A result opens the PDF.js viewer at the matching page | PDFIndexer.py |
| ISEmisc | Text attachments. Full content of .md .txt .text .json .html (HTML reduced to its visible text) and, since MiscIndexer 7.4.1#5, any other flat-text attachment (.csv, .log, no extension, ...). Code and config types (.py .php .js .sh ...) by filename and type only. Also each file's filename and topic subject |
MiscIndexer.py |
| ISEmega | The same query run against ISE, ISEpdf and ISEmisc, merged into one page. It does not include ISEmedia, despite the name | the three above |
| ISEmedia | Images, video and audio, by keyword: filename, internal filename, post subject, AI captions of images and video frames, audio tags, and the speech in videos. Audio can also be filtered by tempo and key | MediaIndexer.py, MediaProcessor.py, AudioProcessor.py, MediaTranscriber.py |
Content is matched against pre-built JSON indexes, not the forum database, so an index only knows what was there when it was last built (Β§5). Filenames and subjects are a partial exception: PDFsearch.py and MediaSearch.py look some of them up in the database at search time (Β§15, Β§21).
ISEmedia loads no AI model at search time. The AI work is done when its stores are built: CLIP (Contrastive Language-Image Pretraining, a model that compares pictures with text) for image vectors, a small vision model for captions, CLAP (its audio counterpart) for audio tags, and a speech model for video transcripts. Re-ordering results with CLIP at search time is an opt-in (--clip, Β§21).
| Box | Hostname | Role in ISE |
|---|---|---|
| Live | forum (forum.drugs-and-users.org) |
The forum and all five searches. Runs the post, PDF and Misc indexers on cron (Β§5.1), MediaIndexer and MediaProcessor (Β§5.2) and MediaTranscriber.py. 4 GB RAM + 4 GB swap. It had 2 GB until 2026-10-09; some notes in this manual date from then and say so |
| Clone | clone |
Runs AudioProcessor.py (its audio model needs about 1.6 GB) and pushes the resulting audio_store.json to Live. MediaProcessor jobs run there too. Runs cleanISE_Clone, which tidies up after them. Clone's /bin holds the master copy of the shared /bin scripts |
| Dev | A mirror of Live. 32-bit, so PDF indexing there uses PDF-32bit-Indexer.py (Β§14) |
The_ISE_Project/ and ISE_Data/. Nothing is shared between instances..json at the root of ISE_Data from Live to Clone and Dev, so the stores stay identical for the coherence check. transcripts_store.json is written on Live.audio_store.json goes the other way: it is built on Clone and pushed to Live. The mirror excludes ISE_Data/audio_store.json*, which also covers its lock and temporary files.python3 (3.6.3 on Live) for the post, PDF and Misc scripts, and python3.8 for the media, audio and transcript scripts. Details in Β§35.<SMF root>/
βββ Sources/Search.php β dispatcher: case 'ISE' / 'ISEpdf' / 'ISEmisc'
βββ Sources/ManageSettings.php β CustomSearch_use_ISE / _ISEpdf / _ISEmisc checkboxes,
β plus the ise_reset_pdfjs / ise_reset_isedata reset checkboxes (Β§9)
βββ Sources/Admin.php β registers CustomSearch in the admin menu
βββ Themes/default/index.template.php β dropdown options
βββ Themes/default/languages/Modifications.english.php β label strings (also patched under
β Themes/default/language/, singular, for installs that use it)
βββ Collabware/core_utils.py β settings and attachment lookup for the Collabware scripts (Β§12)
βββ ISE_Data/ β generated indexes, stores and logs (777, apache-owned)
β βββ word_index.json / post_store.json β posts (IndexBuilder.py)
β βββ word_index_pdf.json / pdf_store.json β PDFs (PDFIndexer.py)
β βββ word_index_misc.json / misc_store.json β Misc text attachments (MiscIndexer.py)
β βββ media_store.json β ISEmedia catalogue of images, video and audio (MediaIndexer.py)
β βββ embeddings_store.json β CLIP vectors (MediaProcessor.py); MediaSearch reads it only with --clip
β βββ captions_store.json β captions of images and video frames (MediaProcessor.py)
β βββ audio_store.json β audio tags, vectors, tempo, key, loudness (AudioProcessor.py, built on Clone)
β βββ transcripts_store.json β speech in videos (MediaTranscriber.py, written on Live)
β βββ pdf_duplicates.json / pdf_dupe_deleted.json β duplicate spotter and its review page (Β§29)
β βββ orphan_state.json β orphan_check.py (Β§28)
β βββ Settings_ISE.json β per-install {"environment", "install"} selector read by ise_settings.py
β βββ hf_cache/ β Hugging Face model cache (CLIP; and CLAP on Clone)
β βββ ise_trace.log, *.log β shared trace log and per-script logs
β βββ lock, checkpoint and status files β listed in each script's section
βββ The_ISE_Project/ β all ISE scripts
β βββ qf_search_bridge.php β web entry point for ISE
β βββ qf_PDFsearch_bridge.php β web entry point for ISEpdf
β βββ qf_Miscsearch_bridge.php β web entry point for ISEmisc
β βββ qf_MegaSearch_bridge.php β web entry point for ISEmega
β βββ qf_Mediasearch_bridge.php β web entry point for ISEmedia (the only bridge that resolves python3.8)
β βββ search.py, PDFsearch.py, MiscSearch.py, MegaSearch.py, MediaSearch.py β the five searches
β βββ IndexBuilder.py, PDFIndexer.py, MiscIndexer.py β text indexers
β βββ MediaIndexer.py, MediaProcessor.py, AudioProcessor.py, MediaTranscriber.py β media indexers
β βββ audio_features.py, audio_vocab.txt β used by AudioProcessor.py
β βββ ise_noindex.py β the #do-not-index rule (Β§6); must sit beside the indexers
β βββ SearchCommon.py, SortEngine.py, ise_settings.py, ise_trace.py β shared modules (Β§25β27)
β βββ QueryParser.py, Tokeniser.py, ANDMatcher.py, IndexLookup.py, RankingEngine.py,
β β ResultFormatter.py, ise_render.py β post parsing, scoring and rendering internals
β βββ orphan_check.py, pdf_duplicate_spotter.py, pdf_dupe_review.php β maintenance tools (Β§28, Β§29)
β βββ reset_ise_data.php β install-time code hook (Β§4)
β βββ ISE_help.html β shared in-app help page (Β§8)
βββ pdfjs/ β bundled PDF.js viewer
Tools kept elsewhere: cleanISE_Clone in /bin on Clone and transcribe_pieces.sh in /root (Β§33, Β§34). Where audio_features_list.py, audio_features2 and chktranscribe are installed isn't recorded here (Β§30β32).
readme.txt in the package): Board-color-and-icons, Automatic Package Version Emulation, CustomSearch.ISE_V<version>.zip through SMF's Package Manager as normal.install_ise.php runs by itself. It creates The_ISE_Project/ and ISE_Data/ with 777 permissions, then starts IndexBuilder.py, PDFIndexer.py, MiscIndexer.py and MediaIndexer.py in the background, so the install itself returns at once. Each writes its own log under ISE_Data/. Since v9.5 it also fills ISE_Data/hf_cache (the CLIP model cache) if it is empty: copied from root's own Hugging Face cache when installing as root, otherwise downloaded in the background.python3.8, not the interpreter the other four use, so a working ISE search says nothing about ISEmedia. The model cache matters only for --clip.Uninstalling reverses the install.xml edits and deletes The_ISE_Project/ only. ISE_Data/ and pdfjs/ are deliberately left alone: they hold generated data (indexes, stores, logs, hf_cache, the PDF.js viewer) that shouldn't vanish because the mod was removed.
An index only knows what was there when it was last built. Rebuild after posts or attachments change, by hand or from cron.
python3)cd <SMF root>/The_ISE_Project
python3 IndexBuilder.py --monitor # posts β word_index.json / post_store.json
python3 PDFIndexer.py --monitor # PDFs β word_index_pdf.json / pdf_store.json
python3 MiscIndexer.py --monitor # text attachments β word_index_misc.json / misc_store.json
IndexBuilder.py and MiscIndexer.py rebuild everything on every run, with no resume, so they are safe to re-run at any time. PDFIndexer.py resumes by default and only adds PDFs it hasn't indexed yet (Β§14).
Suggested cron (adjust to the forum's posting and upload volume):
# Every 2 hours (on the hour) β rebuild the post index
0 */2 * * * python3 /var/www/html/The_ISE_Project/IndexBuilder.py >> /var/www/html/ISE_Data/indexbuilder.log 2>&1
# Every 2 hours (on the half-hour) β rebuild the Misc index
30 */2 * * * python3 /var/www/html/The_ISE_Project/MiscIndexer.py --monitor >> /var/www/html/ISE_Data/misc_indexer.log 2>&1
# Every 6 hours β fast PDF pass (PyMuPDF only)
5 */6 * * * python3 /var/www/html/The_ISE_Project/PDFIndexer.py --fast --monitor >> /var/www/html/ISE_Data/pdfindexer_fast.log 2>&1
# Every 2 days β thorough pass (both extractors) over PDFs not yet indexed.
# Resume mode: PDFs already indexed are skipped, so this is NOT a rebuild (that needs --fresh, see Β§14).
10 0 */2 * * python3 /var/www/html/The_ISE_Project/PDFIndexer.py --monitor >> /var/www/html/ISE_Data/pdfindexer_union.log 2>&1
python3.8)python3.8 MediaIndexer.py catalogues every image, video and audio attachment into media_store.json (Β§19).python3.8 MediaProcessor.py --ft=image --progress (and --ft=video) makes CLIP vectors and captions for new items (Β§20). Mind Live's memory: see Β§20 before using --instances.AudioProcessor.py on Clone tags and measures the audio items listed in media_store.json and writes audio_store.json. Push that file to Live afterwards (Β§22).
python3.8 MediaTranscriber.py transcribes new .mp4 videos into transcripts_store.json; chktranscribe shows how the job is doing (Β§24, Β§32).
cleanISE_Clone --apply clears old temporary files, oversized logs, old checkpoints and stale lock files out of ISE_Data (Β§34).
A post can be kept out of every ISE index, together with all its attachments, by writing #do-not-index in it. One shared module, ise_noindex.py (v1.2.0, 2026-10-17), holds the rule and every indexer calls it. It must sit in the same folder as the indexers; they refuse to run without it. python3 ise_noindex.py --version prints its version.
All three conditions must be true:
#do-not-index is in the post body, in any letter case. The subject line is never looked at, and neither is the text inside attached files.<br />; the count treats <br />, <br>, <br/> and plain newlines alike. On line 6 or later it does nothing. Put it on line 1.The group ids are constants at the top of ise_noindex.py. Check: this manual has called them ADMIN_GROUP / GLOBAL_MOD_GROUP, but an earlier note said PRIVILEGED_GROUPS; the file itself decides. If an account in another group must be able to mark posts, add that group's id there or make the account a moderator of the board.
What is excluded: the post itself, every attachment on it, and the thumbnail record SMF keeps for each image attachment (id_thumb). If the tag is removed later, the post and its attachments are indexed again on the next run.
| Script | Since | Behaviour |
|---|---|---|
IndexBuilder.py (posts) |
7.4.5 | Marked posts are skipped; the summary shows (+N skipped: #do-not-index). Full rebuild every run, so a newly marked post drops out on the next run |
PDFIndexer.py |
8.7.0 | Marked PDFs are never discovered, and anything already indexed is purged at the start of the run (also with --fastest). --single ID on a marked attachment prints REJECTED, removes any existing entry and exits 1 |
MiscIndexer.py |
7.4.1#4 | Attachments of marked posts are left out (catch-all files included); the run prints a skip count. Full rebuild every run |
MediaIndexer.py |
ISE v9.9.10 | Marked images, video and audio are left out of media_store.json. In --single mode the rest of the store is kept, but a marked id is removed |
AudioProcessor.py |
1.3.0 | Marked audio is never encoded; stored items and their windows are removed at the start of every run (also with --attachid). --plan only reports. Push audio_store.json to Live afterwards |
MediaTranscriber.py |
1.0.0 | A video in a marked post is never transcribed, and a stored transcript for one is removed |
MediaSearch.py |
1.11.0 | A transcript is only shown for an attachment still in media_store.json, so one for a newly marked video never surfaces |
Fails closed. If the list of marked posts can't be read from the database, every indexer stops with exit code 1 and writes nothing. None treats a failed lookup as "nothing is excluded".
MediaProcessor.py. Captions and CLIP vectors already made for an image or video that is marked later stay in captions_store.json and embeddings_store.json until MediaProcessor gets the same purge. MediaSearch (as documented at 1.7.1) takes candidates from captions_store.json as well as the catalogue, so such an item may still be found by its caption.PDFsearch.py and MediaSearch.py look some filenames and subjects up in the database while searching. Whether a marked post's subject or attachment filename can still surface that way has not been confirmed. To test: search for a word from the marked post's subject and from one attachment's filename, as an account that can't see the post.The user-facing explanation is in the in-app help (Β§8). This section is the operator's view.
Every source requires every space-separated term by default (AND), as of search.py, PDFsearch.py, MiscSearch.py and MediaSearch.py v7.6.0/7.7.0/7.6.0/1.8.0. Prefix /sort use-OR to accept any term instead. An uppercase AND typed as a keyword is stripped before searching. This is SortEngine.extract_or_mode() (Β§26), called at the top of every get_ranked_results().
"double quotes": an exact phrase, matched case-sensitively, with spaces and punctuation exactly as typed.'single quotes': a known gap. Single quotes are not treated as a phrase; the word is searched with its apostrophes attached, which almost always finds nothing (Β§13, Β§36).claude.ai): matched as that exact string, not as two words.These three share one copy of the matching code, SearchCommon.py (Β§25):
* or ? is matched against the whole name, so anchor it with your own *: *.mp3 ends in .mp3, *sensuous* contains it, sensuous* starts with it.* and ? inside quotes as plain text and skips empty names.* or ? takes the fast exact lookup; only a wildcard term scans the vocabulary.Check: the PDFsearch notes from before SearchCommon described its wildcard matching as case-sensitive, while SearchCommon's rule says names match case-insensitively and PDFsearch 7.8.0 says "no behaviour change". Test a mixed-case filename with a wildcard to see which holds.
/sortType the directive in the search box, like /help. The older #ise-order-<mode> form still works; if both appear, /sort wins. Parsing happens in Python (SortEngine.py, Β§26), not in the bridges.
| Directive | Order | Sources |
|---|---|---|
/sort newest |
poster_time, newest first |
all five |
/sort oldest |
poster_time, oldest first |
all five |
/sort newmod |
modified_time newest first, falling back to poster_time for a post never edited |
ISE (posts) only |
/sort oldmod |
the same, oldest first | ISE (posts) only |
/sort use-OR |
any term instead of every term (Β§7.1) | all five |
poster_time only. They aren't edited the way a post is, so the PDF and Misc stores have no modified_time.newest/oldest do a flat date merge across its three sources (ise_render.merge_by_date()), not a re-sort of the usual interlaced merge. Interlacing exists to stop one source crowding out the others on score, which doesn't matter when sorting by date. newmod/oldmod are not offered there; use ISE (posts) directly.newest/oldest sort the items that match the query's words. A bare /sort newest with no other term lists every item. (In 2026-09 this needed a special gate, because CLIP similarity made every item a candidate; MediaSearch is now keyword-based.)| Source | Default | How to see everything |
|---|---|---|
| ISE, ISEpdf, ISEmisc | No cap through the UI (their bridges pass no --limit) |
β |
| ISEmega | Soft cap of 180 cards (MEGA_SOFT_CAP) |
"Show all" link (&all=1, passed on as --all) |
| ISEmedia | Soft cap of 180 cards (MEDIA_SOFT_CAP), with a red "Showing 180 of N β Show all" notice |
The same "Show all" link |
Everything is still searched and ranked in full; the cap only limits how many cards are drawn. On the command line, --limit N shows exactly the best N. Before bridge v1.1.0, ISEmedia's bridge passed --limit 180, which silently cut results off.
/help)All five search UIs share one help page, The_ISE_Project/ISE_help.html: a single static file, web-accessible through the .htaccess <Files "*.html"> rule. It explains each source's search methods, including how quoting and wildcards differ between sources and the single-quote gap in ISE posts, stated plainly. It documents ISEmega and ISEmedia too (its ISEmedia section was updated for MediaSearch 1.6.0).
Two ways to reach it:
/help as the whole query in any search box (case and surrounding spaces don't matter). Each search script checks for this before searching and copies ISE_help.html into the --html path the bridge asked for, so the bridge's normal readfile() serves it with no PHP changes. On the command line, with no --html, the script prints the file's path instead.ResultFormatter.py's format_html(), PDFsearch.py's write_html() and MiscSearch.py's write_html().How it is wired:
HELP_TRIGGER = "/help"
HELP_HTML_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ISE_help.html")
def _serve_help(html_path):
with open(HELP_HTML_PATH, "r", encoding="utf-8") as f:
content = f.read()
if html_path:
with open(html_path, "w", encoding="utf-8") as f:
f.write(content)
return True
search.py, PDFsearch.py and MiscSearch.py each define this pair; MegaSearch.py reuses search.py's copy and MediaSearch.py defines its own. Both paths log through ise_trace, and an SSH run starts a new trace as a normal search would.
The page carries its own copy of ResultFormatter.py's 13 themes and switcher. On load it reads whichever of ise_search_theme, ise_pdf_theme and ise_misc_theme is set in localStorage, so it opens in the theme last picked on a results page. ISEmedia's own theme key is ise_media_theme.
Two checkboxes on the CustomSearch settings page set a one-shot reset for the next install or reinstall. Both default to unticked. Each clears itself once it has fired, so it can't wipe again on a later reinstall you didn't mean as a reset.
pdfjs/. The library is refreshed on every normal install anyway, so this only matters for a genuinely clean slate, which also removes anything that isn't part of the library, such as hand-made ln symlinks. Re-create those links afterwards; the checkbox label says so.ISE_Data/, which means everything in it: every index and store (posts, PDF, Misc, media catalogue, captions, CLIP vectors, audio, transcripts), hf_cache, the duplicate and orphan state files and all logs. Afterwards every index must be rebuilt (Β§5), audio_store.json pushed again from Clone, and every video transcribed again, which takes a long time.position="before" and position="after" are inverted in this fork's Package Manager compared to stock SMF: before inserts after the matched text, and the other way round. install.xml already allows for this; don't "fix" it back to stock meaning.<search>/<replace> with no position attribute silently does nothing, even though the install preview says "Test successful". Always use position="before|after|replace" with <add>.pdftotext or similar must pass encoding="utf-8", errors="replace", or it crashes on accented letters, curly quotes and dashes in real PDFs. This doesn't apply to the python3.8 scripts, so an encoding problem in one of those is a different problem.<search position="before">/<add> against the same line leave its whitespace inconsistent over a few install cycles, with array entries and $txt[...] lines crammed together. The next mod's search then fails to match ("Skipping Search"). For a settings array or a labelled string block likely to be touched by more than one install, such as the BIOHAZARD:CustomSearch block in Modifications.english.php, replace the whole known block in one position="replace" instead of layering adds.install.xml (a <modification> document) may only hold <file>/<operation> blocks. <uninstall>, <require-file>, <require-dir> and <code> belong in package-info.xml only. A stray <uninstall> block once found inside install.xml was removed.require-dir merges on install; it never deletes. A file already in the destination is only overwritten if the package contains a file of exactly that name. So the ISE_Data/ folder inside any package zip must contain only .htaccess, never real index, store or log names, or a routine reinstall would overwrite live data with the package's empty copies. pdfjs/, by contrast, should contain the full library every time.<!DOCTYPE package-info SYSTEM "http://..."> external reference can fail to resolve (SMF doesn't need it, so it can be dropped), and modern zip tools may write Zip64 or extra-attribute data that this fork's extractor can't read. Build with the legacy zipper, or zip -X -D (no extra attributes, no directory entries), which keeps the archive at plain PKZIP 2.0.qf_search_bridge.php once wrote every search to the same ISE_results.html, so browsers could keep showing an old cached page after an update, with no error. It now uses the unique per-request name the other bridges use (..._<pid>_<microtime>.html). If a results page looks stale after a code update, check whether its bridge writes to a fixed filename before blaming the deployed code.| Symptom | Likely cause |
|---|---|
| Same results whatever the query | The bridge PHP failed silently and served a stale output file |
| A search finds almost nothing on a busy forum | The index wasn't rebuilt after content changed, or an indexer read the wrong instance's Settings.php or attachments folder |
| One instance's search shows another instance's data | A script has a hard-coded absolute path instead of one relative to its own location. Check ATTACH_DIR, WORD_INDEX_PATH, *_STORE_PATH and the bridge's $script |
| Dropdown missing ISE options after install | The index.template.php operation didn't match. Compare tabs and whitespace with the live file using cat -A |
install_ise.php runs but nothing happens |
The_ISE_Project wasn't extracted yet when the code step ran. The code step must come after the extract steps in package-info.xml |
| A settings checkbox shows with no label | The language-string <search> anchor didn't match, usually whitespace. Check the anchor byte for byte against a fresh copy of the live file (cat -A or od -c) |
| Package Manager says "Skipping Search" | The <search> text really isn't in the target file. Pull the file off the server and diff it; an anchor that matched for an earlier version may not match now (Β§10) |
| A patch shows as installed but the page hasn't changed | Look at the raw file on the server. If it is patched, suspect PHP OPcache or SMF's cache: restart Apache or call opcache_reset(), and clear SMF's cache under Admin > Maintenance |
| ISEmega or ISEmedia stops at 180 results | Not a bug: their soft cap. Use "Show all" (Β§7.5) |
| PDF search over SSH prints "ISE ERROR β see ..." for a query with no matches | PDFsearch.py older than 7.5.2 (Β§15) |
orphan_check.py fails at once with ImportError: cannot import name 'BOARD_URL' |
orphan_check.py older than 7.4.2 (Β§28) |
ModuleNotFoundError: No module named 'numpy' or 'torch' from a media script |
Wrong interpreter: the media scripts need python3.8. Over SSH use the full path, /usr/local/bin/python3.8; sudo's secure_path may not include /usr/local/bin |
PermissionError: [Errno 13] ... /.cache from MediaSearch with --clip |
The model cache isn't reachable by apache. Check that ISE_Data/hf_cache/hub/models--timm--vit_base_patch32_clip_224.openai exists and is owned by apache:apache, and read ISE_Data/hf_cache_setup_status.log |
| An ISEmedia result with no visible link to the query | Every card shows its match_evidence (term, field, value). Before 1.2.0, MediaSearch ranked by CLIP similarity alone and could show unrelated items; such a result means an old MediaSearch.py |
| A deleted audio attachment shows in ISEmedia as "No topic found" | Its entry is still in audio_store.json. Run AudioProcessor.py --prune on Clone, then push the store (Β§22) |
[!] No frame from ID n with duration 60.0 |
ffprobe is missing or failed, so MediaProcessor sampled past the end of a short clip (Β§20) |
AudioProcessor says "FATAL: this host is 'forum'" |
It runs on Clone by default. Add --any-host, or --force (from 1.3.1), to run it elsewhere (Β§22) |
| A second run says it is already running | AudioProcessor and MediaTranscriber allow one run at a time. Check with pgrep -fl <name> and wait (Β§22, Β§24) |
The #do-not-index tag is ignored |
The tag is below line 5, or the author isn't a Moderator or above, or the author's group id isn't one ise_noindex.py knows (Β§6) |
ISE's scripts come from two codebases joined into one project. Knowing which one a script belongs to saves chasing a settings or version problem in the wrong place.
| ISE scripts | Collabware scripts | |
|---|---|---|
| Which | search.py, PDFsearch.py, MiscSearch.py, MegaSearch.py, MediaSearch.py, IndexBuilder.py, PDFIndexer.py, MiscIndexer.py |
MediaIndexer.py, MediaProcessor.py (a four-way effort: Andrew, Claude, ChatGPT, Gemini). AudioProcessor.py also uses Collabware's helpers |
| Board URL and paths | ise_settings.py: get_base_url() / get_project_url() read the per-install ISE_Data/Settings_ISE.json ({"environment": ..., "install": ...}) and look the URL up in a hand-checked table |
Collabware.core_utils: get_board_root(), get_data_dir(), load_smf_settings(), locate_attachment_file(), get_attachment_directories() |
| Version numbers | Per file: search.py 7.x, MediaSearch.py 1.x, and so on |
A project-style tag in the doc-block ("ISE v9.9.10", "ISE v9.25") plus a RUNTIME_VERSION string kept in step by hand. Not the same counter as the package's own version (install_ise.php "9.5"). AudioProcessor.py uses its own per-file number |
| Logging | ise_trace.py (Β§27) |
Their own --monitor / --verbose output |
Settings.php for every script. There is no separate config file and no hard-coded credentials.ISE_ROOT: some bridges still set it as an environment variable, but no current Python reads it back. Earlier manuals said settings came "from Settings.php via ISE_ROOT"; that stopped being true with ise_settings.py v4.0 (2026-08-21); 4.0/4.1 brought in Settings_ISE.json.ise_settings.py / Settings_ISE.json problem, and an "ISE v9.x" tag is not the package version.Version: 7.4.5 (2026-10-17). python3.
Builds ISE_Data/word_index.json and ISE_Data/post_store.json from every forum post. Every run is a full rebuild, so it is safe to run at any time; usage and cron are in Β§5.1. Since 7.4.5, posts marked #do-not-index are skipped and the summary ends with (+N skipped: #do-not-index) (Β§6).
Searches the post index. A query goes through QueryParser.parse() β Tokeniser.tokenise() β ANDMatcher.match() β IndexLookup.py's lookup_word() / lookup_phrase():
WORD token, lowercased and looked up directly in word_index.json (the fast path) if it is a plain \w+ string."double quotes": a real PHRASE token, matched by lookup_phrase() as an exact, case-sensitive, literal substring of the raw post text (phrase in post["text"]).'single quotes': not special-cased anywhere. QueryParser.py's regex only recognises "...", so a single-quoted word is caught by the generic \S+ pattern with its quotes. Tokeniser.py's docstring says WORD terms have punctuation stripped, but the code only lowercases. So 'test' stays the literal token 'test', which isn't \w+, and lookup_word() falls back to a case-insensitive literal substring search for 'test', apostrophes included. That almost never matches. A confirmed gap, not a design choice (Β§36).claude.ai): the same fallback, a case-insensitive literal substring match, not claude and ai as separate words.Sort modes accepted (ORDER_KEYS): relevance, score, date (an old alias for newest), newest, oldest, newmod, oldmod, subject, board, author, occurrences. The directive is parsed inside get_ranked_results() itself, so MegaSearch's direct call gets it too; before that, a /sort routed through ISEmega leaked into the query as search words. newmod/oldmod fall back to poster_time for a post never edited (_effective_modified()).
SSH runs write the query to syslog themselves (Β§27). /help is handled as in Β§8.
Version: 8.7.0 (2026-10-17). python3.
Builds the PDF index. It finds every real PDF attachment on disk by magic bytes (the database's stored extension can be wrong), extracts the text of each page and writes:
ISE_Data/word_index_pdf.json: word β list of [id_attach, page] hitsISE_Data/pdf_store.json: id_attach β {filename, pages}Two independent extractors run on every page, and the index takes the union of the words they find:
3.1.0: later versions need Python 3.8+ and crash on this box's 3.6.Tried and rejected: pdfplumber (its dependencies need cryptography compiled, which needs a Rust toolchain this CentOS 6 box doesn't have) and pypdfium2 (no wheel for this platform at any version).
python3 PDFIndexer.py --monitor # thorough (both engines); resumes if re-run
python3 PDFIndexer.py --fast --monitor # PyMuPDF only
python3 PDFIndexer.py --fresh --monitor # full rebuild, ignoring what's indexed
python3 PDFIndexer.py --start-at 5235 --monitor # restart a killed run from a known id
python3 PDFIndexer.py --limit 5 --dry-run --monitor # test without writing
python3 PDFIndexer.py --single 6474 --fast # index and trace one attachment, then exit
| Flag | Default | Description |
|---|---|---|
--attach-dir DIR |
auto (<board root>/attachments) |
Folder to scan for PDF attachments |
--dry-run |
off | Discover and extract only; write nothing |
--limit N |
none | Process only the first N PDFs found (for testing) |
--monitor |
off | Live progress: which engine is running per file, new words per file, and a summary every 5% |
--verbose |
off | Also send log output to stdout, not just the log file |
--fresh |
off | Ignore the existing index and rebuild everything. Without it the run resumes: it loads the index and skips attachments already indexed |
--checkpoint-every N |
25 |
Save progress every N PDFs, so a crash (for example an out-of-memory kill) loses only recent work. 0 saves once at the end |
--start-at ID_ATTACH |
none | Skip every attachment below this id, to restart from a known point |
--fast |
off | PyMuPDF only, skipping pypdf. About 20 times faster per file and lighter on memory, but loses pypdf's extra coverage |
--fastest |
off | Skips attachment ids already in the index. Its full behaviour isn't recorded here; see --help. Refused with --single |
--single ID_ATTACH |
none | Index that one attachment and exit (8.6.1). It is checked with file(1) first: if it isn't a PDF, or no file with that id exists, the run prints REJECTED, exits 1, loads no index and writes nothing. If it is a PDF, it is re-processed even if already indexed and merged into the stores; no other attachment is touched. Prints --single N: trace lines ending with a RESULT line. Refused with --fresh or --fastest |
ise_noindex.py in the same folder.--checkpoint-every limits what such a kill loses, and --fast cuts peak memory a lot. Watch free -h during a full --monitor run if concerned.tokenise() in the script) since 7.4, not a plain .split().--fresh rebuild, because the default resume skips them.pdf_store.json's filename field is always None. resolve_filename() exists but isn't called from main(). PDFsearch.py gets real filenames from the database itself, so search isn't affected (Β§36).Version: 8.6.0 (2026-10-05). The 32-bit edition, rebuilt from PDFIndexer.py 8.6.0 (it replaced the old 32-bit 8.2.3). Same options as 8.6.0, including --single and --fastest. Differences:
get_text() and getText(). Dev's 32-bit builds (1.11.2 and 1.14.21) only have getText(), which made 8.2.3's PyMuPDF pass fail on every file;PDF-32bit-Indexer.py v8.6.0.On Dev it writes Dev's own pdf_store.json / word_index_pdf.json unless run with --dry-run. It was built from 8.6.0, so unless it has been rebuilt since, it has neither 8.6.1's run-one-and-exit --single nor 8.7.0's #do-not-index.
#do-not-index; marked PDFs purged at the start of each run.--single means "run that one and exit". In 8.6.0 it printed its trace and then carried on into the full discovery sweep.--single ID_ATTACH added.Version: 7.8.0 (2026-10-06). python3.
Searches the index PDFIndexer builds, and also checks every PDF attachment's own filename and its topic's subject, so a document titled with the right words is found even when the words never appear in its extracted text.
python3 PDFsearch.py listatt # console, every match
python3 PDFsearch.py heroin --limit 20 # capped, for a quick SSH check
python3 PDFsearch.py heroin --html /var/www/html/ISE_Data/results.html
The query is taken from argv[0] before argparse sees it (7.5.1), so a search starting with - or -- is searched rather than rejected as an unknown option. The query must therefore come first.
| Flag | Default | Description |
|---|---|---|
--limit N |
none (no cap) | Cap the number of results |
--html FILE |
none | Write an HTML results page to this path |
--source {ui,ssh} |
ssh |
Accepts the --source=ui the bridge passes. ise_trace.py works out UI or SSH itself from sys.argv |
id_msg no longer resolves to a post, the result shows "No topic found" instead of an Open PDF link. SMF's dlattach needs a valid topic to serve the file, and there is no working fallback.Query words are matched exactly against word_index_pdf.json. Since 7.8.0 the wildcard test, the vocabulary wildcard and the filename/subject match come from SearchCommon.py (Β§7.3, Β§25), with no change in behaviour; tokenise() stays local because it mirrors this script's own index. A term without * or ? keeps the fast exact path; only a wildcard term scans the whole vocabulary.
UI searches are written to syslog by qf_PDFsearch_bridge.php before the script runs. SSH runs bypass the bridge, so the script logs the query itself (tag ise-pdf-search-ssh, message prefixed [SSH]). Both paths end up in syslog.
SearchCommon.py. No behaviour change.[] instead of the (results, order_mode) pair every caller unpacks. Over SSH that printed "ISE ERROR β see ..." instead of "No matches."; through the bridge it was invisible; through MegaSearch it was logged as "pdf source failed". Now returns [], order_mode.argv[0] before argparse.Version: 7.4.1#5 (2026-10-17). python3.
Builds the index for text attachments. Simpler than PDFIndexer: the files are already text, so there is no extraction step, no second engine and no resume. Every run is a full rebuild.
.md, .txt, .text, .json and .html is read, tokenised and indexed. .html first goes through strip_html_for_indexing(): <script>/<style> blocks are removed with their content, every other tag is stripped and entities are decoded (& β &), using simple regexes rather than a full parser. Only visible text reaches word_index_misc.json. misc_store.json keeps the stripped text (so snippets read well), but the checksum is taken from the original file..py .php .js .sh .sql .css .c .cpp .java .rb .go .rs .pl .xml .yml .yaml .ini .conf (FILENAME_ONLY_EXTENSIONS). Nothing they contain is read or indexed. Their store entry has content: "", zero word counts and filename_only: true: they can be opened through the "Open file" link and found by filename or topic, never by content. .html is deliberately not in this group.Writes:
ISE_Data/word_index_misc.json: word β list of {id_attach, count} hitsISE_Data/misc_store.json: id_attach β full metadata and raw content (filename, file_type, board/topic/message context, headings, word count, checksum, filename_only), resolved once at index time through a join of messages, topics and boards, so MiscSearch.py needs no lookupAny regular file attachment outside the fixed lists is read as plain text and indexed like a .txt: a .csv, a .log, a file with no extension. Its file_type is its extension (none if it has none). Non-binary, flat text only. Left out:
attachment_type other than 0);pdf (PDFIndexer) and MediaIndexer's media list (mp4 webm 3gp jpg jpeg png webp gif mp3 wav m4a flac ogg aac wma);zip 7z gz rar tar ...), executables, Word and Office files (doc docx xls xlsx ppt pptx odt ...), other video, images and fonts. The full list is BINARY_EXTENSIONS in the script;MAX_CATCHALL_BYTES), skipped and logged.The summary prints a Catch-all: line (indexed / skipped as not text-like / over the size limit). #do-not-index applies to catch-all files too.
Plain-text files have no magic number to sniff, and SMF strips the real extension from attachment filenames on disk. So discovery is driven by the database: smf_attachments.fileext is cross-referenced with what is actually on disk (matched by the numeric id_attach prefix), and only attachments present in both are indexed.
python3 MiscIndexer.py --monitor # full rebuild with progress
python3 MiscIndexer.py --limit 5 --dry-run --monitor
python3 MiscIndexer.py --dry-run --monitor # see the Catch-all line before writing anything
| Flag | Default | Description |
|---|---|---|
--attach-dir DIR |
auto (<board root>/attachments) |
Folder to scan |
--dry-run |
off | Discover and read only; write nothing |
--limit N |
none | Process only the first N files found |
--monitor |
off | Live progress and running figures (unique words so far, memory in KB) every ~5% |
--verbose |
off | Also send log output to stdout |
There is no --single. Earlier manuals described a 7.5.0 with --single ID_ATTACH; the actual latest script is the 7.4.1 line, which never had it.
Always printed: attachments matched against indexed, counts skipped as non-UTF-8 or empty, a breakdown by file type, unique words in the index, average words per file, the on-disk size of the index files and the log path. Non-UTF-8 files in the fixed list are skipped and logged, not decoded with a fallback; the log has their names.
ise_noindex.py in the same folder.Tokeniser.py used for posts. A known simplification.# / ## Markdown lines, for .md files only.#do-not-index.--single" entry of 2026-10-01 never matched the real script; the latest before #4 was 7.4.1#3 (dated 2026-10-05), without --single.Version: 7.7.0 (2026-10-06). python3.
Searches the index MiscIndexer builds, and also each file's filename and topic subject, merged into one result per attachment. A title-only match is shown beside content matches, never dropped.
python3 MiscSearch.py listatt
python3 MiscSearch.py heroin --html /var/www/html/ISE_Data/misc_results.html
| Flag | Default | Description |
|---|---|---|
--limit N |
none (no cap) | Cap the number of results |
--html FILE |
none | Write an HTML results page |
--source {ui,ssh} |
ssh |
Accepts the bridge's --source=ui, as in PDFsearch |
word_index_misc.json, filenames and subjects. Wildcards and name matching come from SearchCommon.py since 7.7.0 (Β§7.3, Β§25). Quoted phrases stay case-sensitive against names. The query tokeniser keeps * and ?; MiscIndexer's content tokeniser was left alone, since file content never needs literal wildcard characters.filename_only: true show a "π Filename/type match only" badge instead of a snippet. They can only be found through search_filename_topic().misc_store.json; a search with no matches still prints the full summary, with 0.:root { --var: ... } block at the top of the page, so a theme can be swapped without touching the cards.ise-misc-search-ssh.Version history: 7.7.0 (2026-10-06): tokenise(), the wildcard test, vocabulary wildcard and filename/subject match taken from SearchCommon.py; no behaviour change. 7.5.1: query taken from argv[0] before argparse.
Version: 8.0#20 (2026-09-14). python3.
Calls search.py, PDFsearch.py and MiscSearch.py's get_ranked_results() directly (no subprocess, no CLI layer) and merges the three result lists into one page. It does not include ISEmedia, which is a separate, fifth source.
try/except. A failure is logged through ise_trace as, for example, "MegaSearch.py: pdf source failed" and that source is left empty, so one broken source doesn't take down the other two. Since PDFsearch 7.5.2, "pdf source failed" means a real failure, not just a PDF search with no matches.ise_render.interlace_results(), round-robin across the three lists, so one source's higher raw scores can't push the others off the page. newest / oldest use ise_render.merge_by_date(), a flat poster_time sort. No newmod/oldmod./sort directive is stripped once, in get_mega_results(), before any source sees the query. All three then search a clean query with their default sort, so they can't end up with different sort modes.MEGA_SOFT_CAP = 180. An explicit --limit N wins; else --all (or &all=1) bypasses the cap; else 180 cards are drawn, with a notice and a "Show all" link. Everything is still searched and ranked.ResultFormatter.py's _render_cluster_item() (each post wrapped as a one-item cluster) rather than a hand-copied version, which had drifted out of step before. PDF and Misc cards are MegaSearch's own.python3 MegaSearch.py "your query here" [--html FILE] [--limit N] [--all] [--source {ui,ssh}]
The query is taken from argv[0] (8.0#20), as in PDFsearch and MiscSearch 7.5.1, so it must come first on the command line.
Version: ISE v9.9.10 (2026-10-17). python3.8. Collabware (Β§12).
The first stage of ISEmedia: the catalogue. It reads smf_attachments for media types, works out each file's real path and writes ISE_Data/media_store.json: filename, MIME type (from mimetypes.guess_type()), extension, folder id, file hash and forum context (topic, board, post) for every item. It makes no vectors, captions or tags; MediaProcessor, AudioProcessor and MediaTranscriber do that from this catalogue.
Types catalogued: images jpg jpeg png webp gif (.gif was added late; 70 real GIFs were missed before that), video mp4 webm 3gp, and audio mp3 wav m4a flac ogg aac wma.
| Flag | Description |
|---|---|
| (none) | Rebuild media_store.json from SMF. Only a plain run drops entries for deleted attachments |
--attachid N |
One attachment only |
--single ID_ATTACH |
As --attachid, plus --single N: trace lines ending in a RESULT line (ISE v9.9.1). The rest of the store is kept, except that a #do-not-index attachment is removed (v9.9.10) |
--monitor |
Telemetry and performance figures |
--verbose |
Detailed diagnostics |
pymysql is probed with a soft try: import pymysql, so the script degrades rather than failing outright when it is missing. ise_noindex.py needs it.Version history: ISE v9.9.10 (2026-10-17): #do-not-index. ISE v9.9.1 (2026-10-01): --single.
Version: ISE v9.30 or later. The last full entry is v9.25 (2026-10-06); the v9.30 checkpoint rename is known from cleanISE_Clone (Β§34); the manuals until Master v8 still quoted ISE v9.18. python3.8. Collabware (Β§12).
The second stage of ISEmedia. For each image and video in media_store.json that has no vector yet it makes:
ViT-B-32-quickgelu, openai weights) into embeddings_store.json. The model must match MediaSearch.py's CLIP_MODEL_NAME / CLIP_PRETRAINED exactly, or --clip searches compare vectors from two different spaces, with no error to show it;captions_store.json, through SmolVLM run by llama-mtmd-cli (llama.cpp), chosen because it needs no newer glibc and no Rust toolchain. Skip with --skip-captions.For video it samples --samples frames (default 3) from the first --window seconds (default 30.0), not the whole file, using ffprobe's duration. A run resumes from embeddings_store.json, so deleting a checkpoint loses no work.
python3.8 MediaProcessor.py --ft=image --instances=2 --progress
python3.8 MediaProcessor.py --ft=image --allow-truncated --progress
python3.8 MediaProcessor.py --ft=video --instances=2 --log
| Flag | Description |
|---|---|
--attachid N |
One attachment only. Always runs as one instance |
--chunk-size N |
At most N new items, then stop; re-run to carry on. Applies per instance |
--force / --reindexall |
Re-process items that already have vectors, after a model or caption change |
--skip-captions |
Vectors only |
--samples N, --window S |
Video frames taken, and from how many opening seconds |
--ft=image|video|all |
Split a run by type. image = jpg jpeg png webp gif; video = mp4 webm 3gp; default all. Items of the other type are left alone and not counted as skipped (v9.21) |
--instances N |
Run N copies (1β4) in parallel. Copy k of N takes ids with id % N == k-1; its output lines start [k/N]. Each copy gets cores/N threads for torch and, if llama-mtmd-cli --help lists --threads, for llama (-t). The shared stores are saved under a lock (read, merge this copy's new keys, write), so copies can't overwrite each other (v9.21) |
--progress |
[>] ID n (file) -- k of M in this run as an item starts; [<] ID n done -- k of M, frames, seconds, caption, [<] ID n FAILED -- ... or [<] ID n skipped -- ... when it ends; [~] before a caption retry of an already embedded item. M is the new items in this run, counted first. Already embedded items are skipped silently (--verbose lists them) |
--allow-truncated |
Images whose file is cut short ("image file is truncated") are decoded as far as they go and embedded and captioned from what is there. Without it they fail on every run; re-uploading the file is the alternative (v9.23) |
--log, --monitor, --verbose |
Log file, telemetry, detail |
llama-mtmd-cli caption call adds about 900 MB while it runs. Two instances is the practical ceiling; 3β4 push it into swap and fork() starts failing.--ft=image and --ft=video together): their instances add up. The stores stay safe (same lock); the memory doesn't.MediaTranscriber.py or transcribe_pieces.sh.embeddings_store.json, captions_store.json: the output.ISE_Data/.mediaprocessor.lock: the store lock (with --instances above 1). An empty file locked with flock; never delete it while a run is going (Β§34).processor_checkpoint.ckpt, or processor_checkpoint_i<k>of<N>.ckpt per copy (JSON inside). Before v9.30 they were processor_checkpoint.json and processor_checkpoint_i<k>of<N>.json; anything else that reads the old name must be changed. cleanISE_Clone removes the old names and old per-copy checkpoints (Β§34).[!] FATAL and writes nothing.subprocess.run(text=True) (Python 3.7+), so call it as python3.8, not python3 (3.6.3 on Live)..ckpt.-v error, its stderr is captured, and one [!] No frame from ID n (file): ... line shows ffmpeg's last two error lines (or "exited 0 but wrote no frame"), the ffprobe duration and the sample window. duration 60.0 means ffprobe failed or is missing: samples are then taken at 7.5/15/22.5 s, past the end of any shorter clip. That was the cause on Live, which had no ffprobe (IDs 2416, 4683 and 3711 are 4.9, 5.1 and 7.0 s long). Fix: copy /usr/local/bin/ffprobe from Clone (the same build as Live's ffmpeg). Which frames are taken and what is stored are unchanged.fork() failing for lack of memory (v9.20 only handled it for the caption call, so one failure killed the instance with a traceback).--progress prints FAILED -- no embedding stored for an item that produced nothing (v9.22 said "done, 0 frames") and skipped for a type the script doesn't encode. New opt-in --allow-truncated.--progress. The launcher now polls its instances, so Ctrl-C (or kill -INT on the launcher) stops all of them; v9.21 could miss the signal.--ft and --instances. With one instance and no --ft the behaviour is exactly v9.20.Version: 1.11.0 (2026-10-29). python3.8. Uses ise_settings.py like the other searches (Β§12).
Keyword search over images, video and audio. No model is loaded at search time: CLIP vectors, captions, audio tags and transcripts are all made at index time (Β§19β24). CLIP re-ordering is still available as an opt-in (--clip).
Candidates are every attachment in media_store.json (images, video and audio), plus anything in captions_store.json and audio_store.json. Each term is checked against these fields:
| Field | Source | Match rule | Points |
|---|---|---|---|
| Filename | database a.filename (else media_store) |
Whole string: a plain word is a substring; a wildcard must fit the whole name | 25 |
| Internal filename | <id_attach>_<file_hash>, file_hash from media_store, else from the database query that fetches topics (1.7.1). Omitted when there is no hash |
As filename | 25 |
| Post subject | database m.subject, HTML-unescaped |
As filename | 15 |
| Caption | captions_store (images, and video frames keyed <id>_t<sec>), audio_store items and windows |
Whole words. The best-matching frame or window is shown | 40 |
| Tags | audio_store item tags ([[keyword, prob, group], ...], keyword used) |
Whole words | 40 |
| Transcript | transcripts_store (entries with status done) |
Matched like a caption; the card shows a short snippet around the first hit (1.11.0) | 30 |
match_evidence (term β field β value), shown on every card. Check: the 1.11.0 note says "a name hit still outranks" a transcript hit, which the points above don't explain./sort use-OR switches to OR (Β§7.1).SearchCommon.py since 1.9.0 (Β§7.3, Β§25). A quoted phrase is case-insensitive here; * and ? inside quotes are plain text; empty names are skipped.media_store.json, so one for a video that has left the catalogue (deleted, or its post now marked #do-not-index) never surfaces.bpm:124 (Β±1.5), bpm:122-126, and key:Am, key:A-minor, key:F#, key:Gb-major are taken out of the query before tokenising (parse_filters()).
apply_filters()). The evidence names the windows.The values come from audio_store.json (AudioProcessor 1.1.0 and later): bpm, bpm_range, key, lufs, lra and changes per item, and bpm and key per window. Cards show, for example, 118-128 BPM (124), A minor, -9.8 LUFS, ~14 tracks and the approximate track changes.
python3.8 MediaSearch.py QUERY [--limit N] [--all] [--html FILE] [--clip] [--source {ui,ssh}]
python3.8 MediaSearch.py '*.png'
python3.8 MediaSearch.py '6204_*'
python3.8 MediaSearch.py '"brown horse"'
python3.8 MediaSearch.py '/sort newest *.mp3'
The query is taken from argv[0] before argparse, as in the other searches.
| Flag | Default | Description |
|---|---|---|
--limit N |
none | Show exactly the best N |
--all |
off | Draw every match, bypassing the soft cap. The bridge passes it for &all=1 |
--html FILE |
none | Write the results page. Draws at most MEDIA_SOFT_CAP = 180 cards unless --all or --limit is given, with a red "Showing 180 of N β Show all" notice when it caps |
--clip |
off | Load CLIP and add similarity Γ 150 to image and video matches. Doesn't change which items match. Reads embeddings_store.json, which nothing else here reads |
--keyword-only |
β | Does nothing; kept for compatibility |
--source {ui,ssh} |
ssh |
As in the other searches |
Summary: line.captions_store, audio_store, transcripts_store, embeddings_store) that is missing is fine. One that exists but can't be read is reported with [!] on stderr and as a red line on the results page, and the search carries on without it.get_ranked_results(query, limit=None, keyword_only=True) returns (results, order_mode, clip_note, warnings); it was a 3-tuple before 1.6.0. Importing the module doesn't import torch.qf_Mediasearch_bridge.php v1.1.0 no longer passes --limit 180 (which silently cut results) and passes --all for &all=1. It still resolves python3.8 and sets HF_HOME; that only matters for --clip.RankingEngine.py has no media_ranking_engine(), so 1.6.0 removed the dead import./help serves the shared page (Β§8); ise_trace logging throughout; theme key ise_media_theme.transcripts_store.json, as the new field "transcript" (30 points per distinct term), with a snippet on the card.SearchCommon.py; no behaviour change (old against new on 504 checks, 0 differences)./sort use-OR for OR.file_hash, so an item known only to audio_store or captions_store is still found by 6998_*.media_ranking_engine import removed; the help page's ISEmedia section updated./sort newest brown showed every recent upload.Version: 1.3.1 (2026-11-25). Part of ISEmedia (The ISE Project). Runs on Clone.
AudioProcessor tags the forum's audio attachments (mp3, wav, flac, ogg, m4a, aac, wma) so that ISE's media search can find them by how they sound. It listens to each file with CLAP (Contrastive Language-Audio Pretraining: a model that places sounds and plain-English phrases in the same space, so the two can be compared), scores the file against a list of labels, and measures its tempo, key and loudness. Everything goes into ISE_Data/audio_store.json, which is then pushed to Live, where MediaSearch reads the tags. Live never loads the model.
Every run prints its version once, as it starts:
[*] AudioProcessor v1.3.1 (2026-11-25) -- Collabware / DMS-NX
Clone only, by default: CLAP needs about 1.6 GB of memory at its peak. On any other host the run stops at once with a FATAL line and touches nothing, unless --any-host or --force is given (--force since 1.3.1). ffmpeg and ffprobe must be on the PATH.
python3.8 /var/www/html/The_ISE_Project/AudioProcessor.py --plan # what would be done, and how long
python3.8 /var/www/html/The_ISE_Project/AudioProcessor.py # do it; resumes where it left off
nohup python3.8 /var/www/html/The_ISE_Project/AudioProcessor.py --log > /dev/null 2>&1 &
python3.8 /var/www/html/The_ISE_Project/AudioProcessor.py --version # AudioProcessor.py v1.3.1 (2026-11-25)
A run with no options is always safe: it carries on from the last item it finished.
| Option | Default | What it does |
|---|---|---|
--plan |
Finds every pending file, reads its length, prints the window count and a time estimate, then stops. Changes nothing, so it may run beside a real run | |
--attachid N |
Only this attachment | |
--features-only |
Adds tempo, key, loudness and track changes to items already in the store. CLAP is not loaded; vectors and tags are untouched. With --force: re-measure every item |
|
--prune |
Removes stored items (and long-mix windows) whose attachment is no longer an audio item in media_store.json, then stops. Nothing is encoded. Ignored with --plan |
|
--chunk-size N |
Process at most N pending items, then stop | |
--force |
Re-encode items that are already stored; if the store settings changed, rebuild the whole store. Since 1.3.1 it also lets the run go ahead on a host other than Clone | |
--threads N |
all cores | CPU threads for the model |
--batch N |
4 | Windows sent to CLAP per call |
--long-threshold S |
900 (15 min) | Files longer than this are long mixes. A store setting (see below) |
--stride S |
30 | Long mixes: seconds between window starts. A store setting |
--samples N |
6 | Regular tracks: windows taken per track. A store setting |
--top-k N |
2 | Most tags kept per vocabulary group |
--vocab FILE |
audio_vocab.txt beside the script |
Label vocabulary |
--sec-per-window S |
19.6 | Rate used for --plan's time estimate (Clone smoke test, 2 threads) |
--any-host |
Run on a host other than Clone | |
--monitor |
End-of-run figures: items and windows done, mean rate, peak memory, store size | |
--verbose |
Each file as it starts, encode progress, and everything found: tempo, key, loudness, track changes, every tag with its probability, and a table of every window | |
--debug |
Debug output from the attachment lookup (locate_attachment_file) |
|
--log [PATH] |
ISE_Data/audioprocessor.log |
Also append all output to a log |
--version, -V |
Print AudioProcessor.py v1.3.1 (2026-11-25) and stop |
Store settings. The model, its pinned revision, the window length (10 s), --long-threshold, --stride and --samples are recorded in the store. A run with different values is refused unless --force is given, which rebuilds the whole store: a store never mixes two sampling schemes.
media_store.json present. Any failure: one FATAL line, exit 1, nothing touched.--plan): see "One run at a time" below.media_store.json (MediaIndexer's catalogue), and the store, then checks the store settings.ise_noindex.py. Audio in a marked post is never encoded, and any already in the store (with its long-mix windows) is removed. With --plan the removals are only reported. If the list can't be read, the run stops (exit 1) and touches nothing.media_store.json (attachment deleted from SMF, or media_store.json out of date). --prune removes them. Silence means there are none.--samples evenly spaced 10-second windows, averaged into one vector and one set of tags for the whole track. No per-window entries.--stride seconds. Each window is stored as its own entry, keyed <id>_a<start seconds>, with its own tags, plus an average for the whole mix. Keys never contain _t, which is the video-frame convention MediaSearch relies on.Each vector is scored against the labels in audio_vocab.txt (editable; its header explains the format). In each [group] the top label is always kept, plus up to --top-k in total whose probability is at least half the top one. The tags are also joined into a plain "caption" string, so MediaSearch's keyword match works on them unchanged. The vectors (512 numbers each) are stored, so editing the vocabulary only needs a re-tag, which happens by itself on the next run.
Taken from the same decoded windows by audio_features.py (Β§23):
A failed measurement never fails the item: it is printed and stored as null.
ISE_Data/audio_store.json, rewritten whole and atomically (temporary file, then rename) after every item:
{"_meta": {model, revision, window_s, long_threshold, stride, samples,
vocab_sha1, vocab_labels, features_version, updated, writer},
"items": {"<id_attach>": {filename, extension, duration, class, windows: [start secs],
vector, tags, caption,
bpm, bpm_range, key, key_conf, level_db, lufs, lra, changes}},
"windows": {"<id_attach>_a<start>": {id_attach, start, vector, tags, caption,
bpm, bpm_conf, key, key_conf, level_db}}} # long mixes only
An item is written only when it is completely done, so its presence in items is what lets a run resume correctly.
| File | Read / written | Purpose |
|---|---|---|
ISE_Data/media_store.json |
read | MediaIndexer's catalogue; the list of audio items |
ISE_Data/audio_store.json |
written after every item | The store. Push it to Live after a run |
ISE_Data/audio_store.json.<pid>.tmp |
written during a save | Temporary file. A run killed in the middle of a save (kill -9) can leave one; safe to delete |
ISE_Data/audio_store.json.lock |
written | Run lock; holds the pid and start time of the running process. Safe to leave or delete when nothing is running |
ISE_Data/audio_checkpoint.json |
written | Human-readable progress snapshot |
ISE_Data/audioprocessor.log |
written with --log |
Appended log; each run opens with its start time, version and options |
ISE_Data/hf_cache/ |
read (filled on first download) | CLAP model cache, tried first so no network round trip is needed |
audio_vocab.txt |
read | Label vocabulary, beside the script |
audio_features.py |
imported | Measurements |
ise_noindex.py |
imported | The #do-not-index list; must sit beside AudioProcessor.py |
Collabware/core_utils.py |
imported | Board root, data folder, attachment lookup |
Mirror note: the existing exclude ISE_Data/audio_store.json* already covers the lock file and the temporary files.
--plan locks ISE_Data/audio_store.json.lock. A second run exits at once with "AudioProcessor is already running (pid ...)" and touches nothing. Check with pgrep -fl AudioProcessor, wait for it to finish, then run again. The operating system frees the lock when the process ends, even if it is killed, so it can't go stale.--prune), push audio_store.json to Live as usual: Live's copy keeps the old entries until then.--force --attachid N.tokenizers package (it needs glibc 2.17), the pure-Python RoBERTa tokenizer is used instead and says so. The tags come out the same.Newest first. The source file's doc-block has the full wording.
--force also overrides the Clone-only host check, so a wrapper that passes "$@" through can run it on Live (host forum) with --force. --any-host works as before. --force still re-encodes every stored item, so on another host it means a full re-encode there. The FATAL host line and the --force help say so.#do-not-index on lines 1-5 (author Moderator or above, any letter case) is never encoded, and any already stored (with its long-mix windows) is removed at the start of the run, without --prune. The list comes straight from SMF through the new ise_noindex.py, so it doesn't wait for MediaIndexer's next run; --attachid doesn't narrow it. --plan only reports. If the list can't be read the run stops (exit 1) and touches nothing.--version / -V prints the standard single line, AudioProcessor.py v<version> (<date>), before anything else is imported or touched.--prune help no longer say a backup is made (1.2.0 makes none).--version (before, it was rejected as an unknown option); --help opens with the version line.--prune removes them. Found when attachment #7210, deleted from SMF and re-uploaded as #7222, still showed in search as "[No Subject]" / "No topic found". No backup is made: the store is a rebuildable index, so a wrong prune costs only a re-encode.--features-only --force runs started 11 seconds apart on Clone; both saved through the same audio_store.json.tmp, and one died with FileNotFoundError. Worse, whichever saved last would have overwritten the other's results. Now: (1) a run lock on ISE_Data/audio_store.json.lock; (2) each run writes its own temporary file (name includes the pid); (3) a failed save prints one FATAL line instead of a traceback.--verbose shows each file as it starts, encode progress, and a full report of everything found. The attachment-lookup debug it used to switch on is now --debug.audio_features.py 1.0.0 (numpy only, about 0.1 s per window). New --features-only to measure items already stored.tokenizers package (Live has glibc 2.12; every tokenizers wheel needs 2.17), using the pure-Python tokenizer, which gives the same tags.8fa0f1c6...). A store from 1.0.2 is accepted without a rebuild (same snapshot).laion/clap-htsat-unfused: larger_clap_music gave every track the same tags under transformers 4.27.4. A store built with the old model is refused until rebuilt. Also silences a 5-line tokenizers warning printed at every ffmpeg call.clone is refused before anything is touched. --any-host overrides.Version: 1.0.1 (2026-09-28). Used by AudioProcessor.py 1.1.0 and later.
This module takes signal measurements from audio that AudioProcessor has already decoded (mono float32, 48 kHz). It uses numpy only and loads no model.
| Function | Returns | Method |
|---|---|---|
estimate_bpm(x) |
(bpm, confidence) | Autocorrelation of a spectral-flux onset envelope, for both the kick band (<250 Hz) and the full band, keeping the clearer. Uses a mild prior around 122 BPM and folds into 70β180 |
estimate_key(x) |
(key, confidence) | Chroma (12 kHz copy, 8192-point FFT, median over time so kicks don't dominate), correlated with the KrumhanslβKessler major and minor profiles |
level_db(x) |
dBFS | RMS level |
file_loudness(path) |
(LUFS, LRA) | ffmpeg ebur128 filter over the whole file |
find_changes(windows) |
[start s] | Flags a window where at least two of these change: tempo (by 3 BPM or more), key, or tag overlap (below 34%). Since v1.0.1 a change must also be at least 120 s after the last one kept, so a DJ blend spanning several windows counts once |
summarise(...) |
item summary | median and range of BPM, main key, mean level, LUFS/LRA, changes |
python3 audio_features.py --selftest runs these checks on synthetic audio:
It prints PASS or FAIL.
Newest first.
Version: 1.1.0 (2026-10-29). Runs on Live, at any time, one run at a time. python3.8 (written to run under 3.6 as well).
Transcribes the speech of every .mp4 in media_store.json into ISE_Data/transcripts_store.json, which MediaSearch makes searchable (Β§21). It uses the same engine as the ts script: ffmpeg converts the sound to 16 kHz mono WAV, then llama-mtmd-cli runs Qwen3-ASR-0.6B Q8_0 (an automatic speech recognition model). No torch is loaded.
python3.8 MediaTranscriber.py all pending videos
python3.8 MediaTranscriber.py --dry-run what it WOULD do; changes nothing
python3.8 MediaTranscriber.py --chunk-size 20 at most 20 videos, then stop
python3.8 MediaTranscriber.py --attachid 4683 one video (add --force to redo it)
python3.8 MediaTranscriber.py --stop controlled stop of the running job
python3.8 MediaTranscriber.py --skip 2321 2647 --reason "music, no speech" flag videos; needs no run active
python3.8 MediaTranscriber.py --unskip 2321 clear the flag; the next run takes the video again
nohup python3.8 MediaTranscriber.py > /root/MediaTranscriber.out 2>&1 &
done (text stored), no_audio (no sound track) and empty (a sound track but no speech found) are final and never retried. A video flagged with --skip is stored as empty with skipped: true and a reason; MediaSearch reads only done, so a flagged video is never searched. failed is recorded with attempts and error and retried on later runs up to 3 attempts, then left alone and listed at the end of every run until --attachid N --force. A file that can't be found on disk is not recorded (it is retried every run) and is listed at the end of every run.--skip and --unskip take the run lock, so they refuse (exit 3) while a job is running, because the job holds the store in memory and would overwrite the change. Use --stop, wait for the exit, then flag. --skip only accepts .mp4 ids in media_store.json and won't overwrite a done transcript without --force.--stop, from another session, asks the running job to finish the video it is on, save it and exit 0 with result STOPPED. With no job running it says so and does nothing. Ctrl-C and SIGTERM stop at once: the video in flight is discarded (redone next run), everything saved is intact, exit 130. kill -9 is never needed.flock on ISE_Data/.mediatranscriber.lock, released by the operating system if the process dies. A second start exits 3 and touches nothing.ise_noindex.py (it must sit beside the script, and needs pymysql, as MediaIndexer does). If the list can't be read the run aborts (exit 1) with nothing touched.-n (--max-tokens, default 1024). A piece whose text is one phrase repeated over and over (the model looping on music or noise: the text compresses to under 12% of its size, at 200+ characters) is treated as no speech and dropped with a [*] line; if every piece is dropped the video is recorded empty, and dropped_pieces is kept in its entry. This threshold hasn't been tested against the real model. Per-piece timeout --chunk-timeout (default 600 s); --threads (default 2) is llama's -t, as in ts.done transcript is also appended to /root/transcripts_all.txt (--archive PATH to change) under an === name (ID n) === line.[>] / [<] pair per video, a run summary, and one MEDIATRANSCRIBER_RUN time=... result=... done=... no_audio=... empty=... failed=... line per run for a log. Every failure prints a [!] line when it happens and again at the end. Results: COMPLETE, STOPPED, INTERRUPTED, ABORTED (3 videos in a row couldn't even start a process, probably out of memory), SKIPPED (locked).transcripts_store.json. Like every .json at the root of ISE_Data, it must reach Clone and Dev by the mirror so the coherence check stays identical.llama-mtmd-cli at a time. Don't run it at the same moment as a MediaProcessor run on Live.| File | Purpose |
|---|---|
transcripts_store.json |
The store |
.mediatranscriber.lock |
Run lock |
.mediatranscriber.stop |
Exists only while a stop is pending |
.mediatranscriber.status |
The video in flight; removed when the run ends; read by chktranscribe |
transcribe_tmp/ |
Working audio, removed after each video and at the start of every run |
--skip / --unskip); -n cap on every model call (--max-tokens); the repetition guard with its dropped_pieces count.Version: 1.0.0 (2026-10-06).
One copy of the query and matching code used by PDFsearch.py, MiscSearch.py and MediaSearch.py. It lives in The_ISE_Project/ beside them and is imported the way SortEngine.py is. It must be installed on every host that runs those three. python3 SearchCommon.py prints its version and runs a self-check.
* or ? is matched against the whole name, so anchor it yourself: *.mp3 ends in .mp3, *sensuous* contains, sensuous* starts with.* and ? inside quotes as plain text and skips empty names.search.py (posts) and PDFsearch.tokenise(), which mirror their own indexes. *.mp3 has no meaning for post or PDF content.Adopted by MediaSearch 1.9.0, MiscSearch 7.7.0 and PDFsearch 7.8.0, all with no behaviour change.
Shared parsing of the /sort directive (Β§7.4), used by all five search scripts, so it is recognised the same way everywhere. Built in v9.3.0: v9.2's help page had promised /sort newest|oldest|newmod|oldmod before the code did it. The older file of the same name was dead code that nothing called.
def extract_order_mode(query: str, valid_modes: set, default: str) -> tuple:
# strips a /sort <mode> or #ise-order-<mode> directive out of query,
# resolving it against the caller's own valid_modes set.
# Returns (cleaned_query, order_mode).
/sort is checked first (the documented syntax); #ise-order- is the older internal form, still recognised. If both appear, /sort wins.extract_or_mode() (v8.1) handles /sort use-OR and the uppercase AND keyword (Β§7.1).| Caller | Accepted modes | Notes |
|---|---|---|
search.py |
relevance, score, date, newest, oldest, newmod, oldmod, subject, board, author, occurrences |
Parsed inside get_ranked_results() (Β§13) |
PDFsearch.py |
relevance, score, newest, oldest |
No newmod/oldmod |
MiscSearch.py |
relevance, score, newest, oldest |
The same |
MegaSearch.py |
relevance, score, newest, oldest |
Stripped once in get_mega_results(), before any source sees the query (Β§18) |
MediaSearch.py |
relevance, score, newest, oldest |
The same shape as PDF and Misc |
SortEngine's own doc-block (v8.0, 2026-09-14) names only search.py, PDFsearch.py and MiscSearch.py as callers; it predates MediaSearch, which does import it.
ise_noindex.py (v1.2.0, 2026-10-17): the #do-not-index rule (Β§6). Imported by IndexBuilder.py, PDFIndexer.py, MiscIndexer.py, MediaIndexer.py, AudioProcessor.py and MediaTranscriber.py. Must sit beside them. Runs on Python 3.6 and 3.8; uses mysql.connector, else pymysql; reads database settings from Settings.php like the other indexers.ise_settings.py: the board and project URL for the ISE scripts, from Settings_ISE.json (Β§12).SearchCommon.py, SortEngine.py: Β§25, Β§26.Collabware/core_utils.py: settings and attachment lookup for the Collabware scripts (Β§12).ise_trace.py: the shared tracing module, imported by all five search scripts and by the post, PDF and Misc indexers (not by MediaIndexer or MediaProcessor). An SSH run starts a fresh block in ISE_Data/ise_trace.log with new_trace(); a UI run (seen from the bridge's --source=ui) continues the request's existing trace. MiscIndexer.py always starts a fresh block, since no bridge ever runs it. All five search scripts wrap their main function in a top-level handler that logs the full traceback through ise_trace.log_exception() before exiting non-zero.ise_trace.log is detailed pipeline tracing for debugging. syslog (facility LOCAL0) is the audit trail of search queries, read with daily_queries.py / query_log_reader.py. UI searches reach it through the PHP bridges (and Search.php); SSH runs of search.py, PDFsearch.py and MiscSearch.py log their query themselves, with the message prefixed [SSH] (tags ise-pdf-search-ssh and ise-misc-search-ssh for PDF and Misc), a gap that was caught and closed in all three. MediaSearch.py's UI queries are logged by qf_Mediasearch_bridge.php.Version: 7.4.2 (2026-09-24). python3. A maintenance report meant for cron, not part of any search.
Finds attachments whose id_msg no longer resolves to a row in smf209_messages: the post they were uploaded against is gone (deleted, moved, or never finished). Avatars are left out: SMF stores them as attachments with id_msg=0 by design, and they would otherwise swamp every report with about 360 harmless entries. A small state file, ISE_Data/orphan_state.json, lets each run report only what is new since the last.
python3 orphan_check.py # text report to stdout
python3 orphan_check.py --html out.html # HTML report
python3 orphan_check.py --quiet-if-empty # print nothing when there are no new orphans (for cron)
7.4.2 (2026-09-24): every run had failed at once with ImportError: cannot import name 'BOARD_URL' from 'PDFsearch'. PDFsearch's BOARD_URL had been renamed BASE_URL when its settings moved onto ise_settings.py (v4.0, 2026-08-21), two days after orphan_check's last edit (2026-08-19). orphan_check never used it, so it was dropped from the import, leaving from PDFsearch import DB_CONFIG, ISE_ROOT.
pdf_duplicate_spotter.py (python3) finds byte-identical PDF duplicates in the attachments folder: the same file uploaded again under a different id_attach, usually with a different filename or topic. It does not find near-duplicates (a different scan of the same book, an edited copy); PIHKAL/TIHKAL, for example, don't show up, as expected.
It reuses existing code instead of copying it: discover_pdfs() / ATTACH_DIR from PDFIndexer.py, and DB_CONFIG, get_topic_for_attachment() and build_download_url() from PDFsearch.py. Method: SHA-256 over each file's bytes, read in 1 MB chunks so no whole PDF is held in memory. Files with the same hash are identical, with no false positives possible.
| Flag | Default | Description |
|---|---|---|
--attach-dir DIR |
ATTACH_DIR (from PDFIndexer) |
Folder to scan |
--json PATH |
ISE_Data/pdf_duplicates.json |
Where to write the report. pdf_dupe_review.php reads this path, so leave it unless you move that too |
python3 pdf_duplicate_spotter.py
python3 pdf_duplicate_spotter.py --json /tmp/dupes.json
pdf_dupe_review.php is an admin-only page in The_ISE_Project/ that reads the spotter's JSON and lists every duplicate copy with two links: View post, and Delete post (one click, confirmed in JavaScript, guarded by SMF's session token). Delete removes the whole post through SMF's own removeMessage(), which also removes its attachment. The message row is first copied to ise_pdf_dupe_backup_v2 (metadata only, not the PDF: a record, not an undo, since SMF assigns new ids on delete), and deleted ids are remembered in ISE_Data/pdf_dupe_deleted.json so they stop appearing without re-running the spotter. An orphaned copy (its post already gone) still appears in its group but has no View or Delete link.
Version: 1.0.6 (2026-10-06). Runs on Live, Clone or Dev (standard library only, Python 3.6+).
Read-only listing of every audio item's features from ISE_Data/audio_store.json: a "no" column (n/total), id, file name (from media_store.json, always shown in full, extension added if missing), size, BPM, BPM range, key, loudness (LUFS), loudness range (LRA), number of track changes and the item's tags, with a Path line under each file. Files are separated by a line of 9 dashes followed by a blank line. Writes nothing except the optional CSV.
Each file is found the same way AudioProcessor finds it, through Collabware's locate_attachment_file(). --attach-dir is only a fallback.
Check: that lookup goes through Collabware and the database, so "standard library only" above may no longer be true.
python3.8 audio_features_list.py # table, by id
python3.8 audio_features_list.py --sort bpm # also: name, key, lufs
python3.8 audio_features_list.py --csv out.csv # also write a CSV
python3.8 audio_features_list.py --data-dir DIR # default /var/www/html/ISE_Data
python3.8 audio_features_list.py --attach-dir DIR # fallback only; default /var/www/html/attachments
An item with no BPM has not had its features measured yet; run AudioProcessor.py --features-only on Clone for those.
Newest first.
--attach-dir (default /var/www/html/attachments)locate_attachment_file(), like AudioProcessor; --attach-dir only a fallbackVersion: 1.0.0 (2026-10-06). Runs on Live, Clone or Dev (standard library only, Python 3.6+).
Read-only report of every stored feature of every audio item in ISE_Data/audio_store.json: tempo, key, loudness, track changes, tags by group, caption and any other field (vectors left out). Replaces the old one-line python3 -c command. Writes nothing.
audio_features2 # all items, by ID
audio_features2 --id 6982 # one item
audio_features2 --windows # add the per-window table for long mixes
audio_features2 --sort bpm # id (default), name, bpm, key, lufs
audio_features2 --raw # exactly the old one-liner's output
audio_features2 --data-dir DIR # default /var/www/html/ISE_Data
A missing or bad store gives a one-line message and exit 1, with no traceback.
Version: 1.1.0 (2026-10-29). A read-only monitor for MediaTranscriber (Β§24): running, idle or died; what it is on now; progress, speed and time left; failures; cross-checks. It changes nothing and takes no lock; it finds the job in /proc.
chktranscribe # one report
chktranscribe --watch 30 # repeat every 30 s (Ctrl-C leaves it; the job is not affected)
ISE_Data from --data, else $ISE_DATA, else the constant DEFAULT_DATA at the top of the script (/var/www/html/ISE_Data; change it there if Live's board root differs).--skip are counted and listed on their own, with their reason (1.1.0), not under "no speech".Version history: 1.1.0 (2026-10-29): flagged videos listed separately. 1.0.0 (2026-10-29): first version.
Version: 1.0.0 (2026-09-26) Β· DM2S/NX (ISE) Β· Collabware
Transcribes the speech in a video or audio file with Qwen3-ASR-0.6B through llama-mtmd-cli. It cuts the audio into short pieces first (30 s by default), so no single call overflows the model context. A whole 5-minute track in one call failed with failed to find a memory slot.
The steps are:
ffmpeg extracts the audio as 16 kHz mono PCM, the same as transcribe.sh.ffmpeg -f segment cuts it into N-second pieces. This step doesn't need ffprobe, which Live didn't have when this tool was written (Β§20, v9.25).llama-mtmd-cli runs once per piece, with stdin from /dev/null and --temp 0.[mm:ss] start time./root/transcribe_pieces.sh /root/instagram-1790217713252.mp4 # 30 s pieces
/root/transcribe_pieces.sh /root/instagram-1790217713252.mp4 20 # 20 s pieces
KEEP=1 /root/transcribe_pieces.sh <file> # keep pieces + per-piece logs
| Variable | Default (Live paths) |
|---|---|
LLAMA_BIN |
/root/llama.cpp/build/bin/llama-mtmd-cli |
ASR_MODEL |
/root/models/qwen3-asr/Qwen3-ASR-0.6B-Q8_0.gguf |
ASR_MMPROJ |
/root/models/qwen3-asr/mmproj-Qwen3-ASR-0.6B-Q8_0.gguf |
ASR_PROMPT |
Transcribe this audio. |
OUT_DIR |
/root/transcripts |
KEEP |
0 (set to 1 to keep the work folder) |
To run it on Clone, set LLAMA_BIN, ASR_MODEL and ASR_MMPROJ to Clone's paths.
<OUT_DIR>/<name>.transcript.txt has one [mm:ss] text line for each good piece, with the language English<asr_text> tag removed.<OUT_DIR>/<name>.raw.txt has the model's output for every piece exactly as it was printed, including failed pieces.[+] means the piece succeeded. The first 70 characters of its text are shown.[!] means a failure: a missing file, an ffmpeg error, a non-zero exit, the memory-slot error, or empty output. It always prints, and the run carries on to the next piece.[*] SUMMARY: is printed at the end of every run, including aborted ones.0 if all pieces succeeded, 1 if any failed, and 2 if the run failed before it started.transcribe.shASR_PROMPT.--temp 0 makes the output repeatable.< /dev/null stops the program from using the SSH terminal as input. This is the same problem MediaProcessor ran into.The model and mmproj together are about 1 GB on disk. On Live (2 GB when this was written; 4 GB + 4 GB swap since 2026-10-09), avoid running this while MediaProcessor is captioning. MediaTranscriber (Β§24) does the same job for every video as a restartable job.
Version: 1.0.4 (2026-10-16) Runs on: Clone, as root. Lives in /bin (Clone's /bin is the master). Author: Another collaboration between Andrew.human and Claude.ai
Keeps /var/www/html/ISE_Data free of leftovers, so it can be run often. It is deliberately small: it matches five kinds of file and nothing else.
cleanISE_Clone # dry run: prints what it would do, changes nothing
cleanISE_Clone --apply # does it
cleanISE_Clone --version # prints the version and exits
cleanISE_Clone -h # prints the usage and exit-code lines
--all-checkpoints (the v1.0.1 option) is still accepted, so older command lines keep working, but it does nothing: since v1.0.3 that behaviour is the default.
Run it with bash cleanISE_Clone or directly (./cleanISE_Clone, /bin/cleanISE_Clone), never with sh. On CentOS 6 sh is bash in POSIX mode, which refuses the done < <(find ...) loops: syntax error near unexpected token '<'.
The version line is printed once, at the start of every run.
Exit codes: 0 ok, 1 ISE_Data missing or an action failed, 2 bad argument, 3 the old-named checkpoint files were left alone because something is running (the other rules still ran).
Only files directly inside ISE_Data are looked at (no subdirectories).
| # | Matches | Condition | Action |
|---|---|---|---|
| 1 | *.tmp |
older than TMP_MIN (60 min) |
deleted |
| 2 | *.log |
bigger than LOG_MAX_KB (2048 KB) |
copied to <name>.log.1 (old .1 becomes .2, old .2 overwritten), then the original is emptied in place |
| 3a | processor_checkpoint.json and processor_checkpoint_i*of*.json (the names MediaProcessor used before v9.30) |
nothing is running: any age. Something is running: only the _i*of* ones, and only if older than CKPT_MIN (1440 min = 1 day) |
deleted |
| 3b | processor_checkpoint_i*of*.ckpt (current per-instance names, MediaProcessor v9.30 and later) |
older than CKPT_MIN (1440 min = 1 day) |
deleted |
| 4 | audio_store.json.pre* (hand-made restore copies, e.g. audio_store.json.pre2419) |
older than PRE_MIN (10080 min = 7 days) |
deleted |
| 5 | audio_store.json.lock |
older than PIDLOCK_MIN (60 min) and the process id written in it (pid N, started ...) no longer exists |
deleted |
The five values (TMP_MIN, LOG_MAX_KB, CKPT_MIN, PRE_MIN, PIDLOCK_MIN) and the two paths (DIR = /var/www/html/ISE_Data, PROJ = /var/www/html/The_ISE_Project) are variables at the top of the script.
Rule 5 prints left alone instead when the file has no pid N, in it, or when process N still exists.
Only rule 3a depends on it. The script counts something as running if any of these is true:
python*, py, ffmpeg, ffprobe or llama-mtmd-cli whose working directory is PROJ, or whose command line contains PROJ or DIR, or that has a file open under DIR;flock -n): .mediaprocessor.lock, .mediawatchdog.lock, audio_store.json.lock (all in ISE_Data) and MediaIndexer.lock (in $TMPDIR, else /tmp);flock is not installed (the locks cannot be checked, so it is treated as busy).When any of them is found, the script prints what it found, leaves the checkpoint files rule 3a would have removed, still runs every other rule, and exits 3. A plain shell script that holds none of those locks is not detected.
MediaProcessor v9.30 writes processor_checkpoint.ckpt and processor_checkpoint_i<k>of<N>.ckpt (still JSON inside). The .ckpt names are deliberately not matched by the .json rule, so the last run's checkpoint survives cleanup. Old-named .json files already in ISE_Data are removed by rule 3a when nothing is running. Anything outside MediaProcessor that reads processor_checkpoint.json must be changed to the new name.
No rule matches any of these, so they are never removed or changed: *_store.json, word_index*.json, processor_checkpoint.ckpt, audio_checkpoint.json, caption_failures.json, chain_snapshot.json, orphan_state.json, pdf_duplicates.json, pdf_dupe_deleted.json, and the lock files .mediaprocessor.lock and .mediawatchdog.lock.
word_index_media.json: no .php, .py or .sh under the web root names it, but the md5 comparison scripts do not exclude it, so removing it means removing it from Live, Clone and Dev together. Do that by hand if wanted.rw-rw-rw- on some files): set by whatever creates the files and carried by the mirrors. Fix at the source, not here..mediaprocessor.lock, .mediawatchdog.lock: empty files that programs lock with flock. The lock belongs to the open file, not to the name, and the OS drops it when the program ends, so they cannot go stale. Deleting one while it is held lets a second program lock a new file of the same name, and both then think they hold the lock.23 * * * * /bin/cleanISE_Clone --apply >> /var/log/cleanISE_Clone.log 2>&1
Each run writes a few lines, so that log grows slowly. Check it now and then. The cron line needs --apply; without it every run is a dry run. An exit code of 3 in that log only means a job was running at that moment and the old-named checkpoints were left until the next run.
-mmin uses the file's modification time, so a checkpoint or .tmp being written right now is never old enough to match.flock on audio_store.json.lock and a new job starts in the instant between the script's check and its delete, two jobs could run at once. The age and process checks make that very unlikely.embeddings_store.json, so deleting a checkpoint loses no work.| Version | Date | Change |
|---|---|---|
| 1.0.0 | 2026-10-12 | First release: stale *.tmp removal, size-capped *.log rotation, old per-instance processor checkpoint removal. Dry run by default. |
| 1.0.1 | 2026-10-16 | Added --all-checkpoints: also removes processor_checkpoint.json and every per-instance checkpoint regardless of age, but only when nothing is running (exit 3 if something is). Arguments can be combined (--apply --all-checkpoints). |
| 1.0.2 | 2026-10-16 | Rule 4: audio_store.json.pre* older than 7 days is removed. |
| 1.0.3 | 2026-10-16 | Removing the old-named checkpoints when nothing is running is now the default (--all-checkpoints still accepted, does nothing). Goes with MediaProcessor v9.30 (.ckpt names): old .json names removed when idle, .ckpt names kept (per-instance ones once older than CKPT_MIN). |
| 1.0.4 | 2026-10-16 | Rule 5: a stale audio_store.json.lock (pid gone, older than 60 minutes) is removed. |
| Interpreter | Scripts | Why |
|---|---|---|
python3 (3.6.3 on Live, CentOS 6) |
search.py, PDFsearch.py, MiscSearch.py, MegaSearch.py, IndexBuilder.py, PDFIndexer.py, MiscIndexer.py, orphan_check.py, pdf_duplicate_spotter.py |
The original stack. Not moved to 3.8: no evidence they need it, and changing it risks scripts that work |
python3.8 |
MediaIndexer.py, MediaProcessor.py, MediaSearch.py, AudioProcessor.py, MediaTranscriber.py |
torch, open_clip and numpy are installed only under 3.8; MediaProcessor also needs 3.7+ for subprocess.run(text=True) |
python3.8, never bare python3. Over SSH use the full path /usr/local/bin/python3.8 if an alias or sudo's secure_path gets in the way. Under bare python3 they fail on import numpy / import torch before doing anything. qf_Mediasearch_bridge.php resolves python3.8 itself, and install_ise.php v9.5 does the same for its background MediaIndexer run.pip install --upgrade move past these without re-testing:
pymupdf==1.19.2 (later versions have no cp36 wheel)pypdf==3.1.0 (5.x uses typing.Protocol, missing before 3.8, and crashes on import)mysql-connector-python for MiscIndexer and MiscSearch (and, first choice, ise_noindex.py); pymysql for the Collabware scripts, MediaTranscriber, and ise_noindex.py as its fallback.transformers and the CLAP model in ISE_Data/hf_cache; it works without the Rust tokenizers package (Β§22). ffmpeg and ffprobe must be on the PATH.llama-mtmd-cli serves both the captions (SmolVLM, MediaProcessor) and speech (Qwen3-ASR, MediaTranscriber and transcribe_pieces.sh).search.py doesn't, because its matching runs through QueryParser, Tokeniser, ANDMatcher and IndexLookup and needs its own implementation (Β§13).#do-not-index. Captions and vectors of newly marked images and videos stay until MediaProcessor gets the same purge (Β§6.3).#do-not-index at search time, not yet run (Β§6.3).pdf_store.json filenames are always None; resolve_filename() isn't wired into main() (Β§14).Check: points in this manual: Β§6.1 (group constant names), Β§7.3 (PDF name case), Β§21 (transcript against name points; MediaSearch 1.10.x changes not recorded), Β§30 ("standard library only").Changes to the scripts are recorded in each script's own section. This history covers the manual.
ISE_Manual.md (the operator manual) and ISE_Python_Scripts_Manual.md (Master v8, the code-level reference) merged into one, together with every separate manual and manual entry: AudioProcessor, audio_features, audio_features_list, audio_features2, MediaProcessor (ISE v9.21β9.25), MediaTranscriber and chktranscribe (1.1.0), SearchCommon (1.0.0, with MediaSearch 1.9.0, MiscSearch 7.7.0 and PDFsearch 7.8.0), transcribe_pieces.sh and cleanISE_Clone. Duplicated sections merged (wildcards, sorting, /help, interpreters). Brought up to date from the newest material: Live's memory (4 GB + 4 GB swap); ISEmedia as keyword search over images, video and audio with CLIP as opt-in; MediaSearch 1.11.0 with transcripts; ISEmedia's soft cap and bridge v1.1.0; MediaProcessor's separate stores and .ckpt checkpoints; MediaIndexer's audio types; the hf_cache used by AudioProcessor; what the "Wipe ISE_Data" checkbox really deletes; MiscIndexer's options without the --single that never existed. Unsettled points marked Check:. Script history entries that had collected here moved to their sections.#do-not-index documented (rule, ise_noindex.py 1.2.0, per-indexer behaviour, fail-closed, gaps). Correction: MiscIndexer "7.5.0 / --single" didn't match the real script.argv[0] fix.--single added to the body; MegaSearch's "known caveat" rewritten as fixed in PDFsearch 7.5.2./sort use-OR) and v2 (--single entries and the version history). Where they disagreed on MediaSearch word combining, v1's AND was kept.ISE_help.html audited together against the v9.5 source.