add overrides options to binproviders

This commit is contained in:
Nick Sweeting
2025-12-26 20:39:56 -08:00
parent 9bc5d99488
commit 2f81c0cc76
16 changed files with 546 additions and 599 deletions

View File

@@ -6,13 +6,8 @@ Runs at crawl start to verify readability-extractor is available.
Outputs JSONL for InstalledBinary and Machine config updates.
"""
import os
import sys
import json
import shutil
import hashlib
import subprocess
from pathlib import Path
def find_readability() -> dict | None:
@@ -30,22 +25,9 @@ def find_readability() -> dict | None:
'sha256': loaded.sha256 if hasattr(loaded, 'sha256') else None,
'binprovider': loaded.binprovider.name if loaded.binprovider else 'env',
}
except ImportError:
pass
except Exception:
pass
# Fallback to shutil.which
abspath = shutil.which('readability-extractor') or os.environ.get('READABILITY_BINARY', '')
if abspath and Path(abspath).is_file():
return {
'name': 'readability-extractor',
'abspath': abspath,
'version': None,
'sha256': None,
'binprovider': 'env',
}
return None