diff --git a/CLAUDE.md b/CLAUDE.md index 7192490..dfb133d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -194,11 +194,11 @@ neopig supports multiple screenshot backends via uri2png. Auto-detects the light python neopig.py --list-engines # Use specific engine -python neopig.py https://example.com --screenshot --screenshot-engine wkhtmltoimage +python neopig.py https://example.com --screenshot-engine wkhtmltoimage python archive.py https://example.com --screenshot-engine cutycapt -# Auto-detect (default) - picks lightest available -python neopig.py https://example.com --screenshot +# Disable screenshots +python neopig.py https://example.com --no-screenshot ``` **Recommendation:** Install `wkhtmltopdf` for fast, lightweight screenshots without browser downloads. @@ -221,8 +221,11 @@ python neopig.py https://example.com --depth 5 --max-pages 500 # Index only (no download) python neopig.py https://example.com --no-download -# Enable screenshots (requires uri2png) -python neopig.py https://example.com --screenshot --screenshot-width 1920 --screenshot-height 1080 +# Custom screenshot viewport (screenshots enabled by default) +python neopig.py https://example.com --screenshot-width 1920 --screenshot-height 1080 + +# Disable screenshots +python neopig.py https://example.com --no-screenshot # Backfill markdown with absolute URLs (after crawl, fixes image hydration) python neopig.py --backfill-markdown example.com --db data/neopig.db diff --git a/README.md b/README.md index 0787a63..bea702f 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,11 @@ python neopig.py https://example.com --depth 5 --max-pages 500 --mode images # Index URLs without downloading python neopig.py https://example.com --no-download --mode images -# Enable page screenshots (requires uri2png) -python neopig.py https://example.com --mode images --screenshot +# Disable page screenshots (on by default, requires uri2png) +python neopig.py https://example.com --mode images --no-screenshot # Screenshots with custom viewport -python neopig.py https://example.com --mode images --screenshot --screenshot-width 1920 --screenshot-height 1080 +python neopig.py https://example.com --mode images --screenshot-width 1920 --screenshot-height 1080 ``` ### Options @@ -68,8 +68,8 @@ optional arguments: --no-download Don't download media, just index URLs -v, --verbose Verbose output -screenshot options (all off by default, requires uri2png): - --screenshot Enable page screenshots +screenshot options (on by default, requires uri2png): + --no-screenshot Disable page screenshots --screenshot-width Viewport width in pixels (default: 1280) --screenshot-height Viewport height in pixels (default: 1024) --screenshot-delay Delay after page load in ms (default: 1000) diff --git a/neopig.py b/neopig.py index d268c3b..5cd93ed 100644 --- a/neopig.py +++ b/neopig.py @@ -1553,11 +1553,11 @@ async def main(): help="Verbose output" ) - # Screenshot options (all off by default) + # Screenshot options (on by default) parser.add_argument( - "--screenshot", + "--no-screenshot", action="store_true", - help="Enable page screenshots (requires uri2png)" + help="Disable page screenshots" ) parser.add_argument( @@ -1754,14 +1754,14 @@ async def main(): # Create screenshot config from args screenshot_config = ScreenshotConfig( - enabled=args.screenshot, + enabled=not args.no_screenshot, width=args.screenshot_width, height=args.screenshot_height, delay=args.screenshot_delay, engine=args.screenshot_engine, ) - if args.screenshot: + if not args.no_screenshot: engine_info = f", engine={args.screenshot_engine}" if args.screenshot_engine else " (auto-detect)" logger.info(f"Screenshots enabled: {screenshot_config.width}x{screenshot_config.height}, delay={screenshot_config.delay}ms{engine_info}") diff --git a/screenshot.py b/screenshot.py index 73a9920..b204727 100644 --- a/screenshot.py +++ b/screenshot.py @@ -55,7 +55,7 @@ NATIVE_ENGINES = {'wkhtmltoimage', 'cutycapt'} @dataclass class ScreenshotConfig: """Screenshot capture configuration.""" - enabled: bool = False + enabled: bool = True width: int = 1024 height: int = 768 delay: int = 1000 # ms after DOM load