fixed chunk output

This commit is contained in:
Dionysus 2025-02-12 00:35:35 -05:00
parent 41d7e53d30
commit 6dacafeee5
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE
3 changed files with 6 additions and 4 deletions

View File

@ -6,4 +6,4 @@ from .colors import Colors
from .scanner import HTTPZScanner from .scanner import HTTPZScanner
__version__ = '2.1.2' __version__ = '2.1.3'

View File

@ -152,10 +152,11 @@ async def main():
if args.output: if args.output:
with open(args.output, 'a') as f: with open(args.output, 'a') as f:
f.write(json.dumps(result) + '\n') f.write(json.dumps(result) + '\n')
f.flush() # Ensure file output is immediate
# Handle JSON output separately # Handle JSON output separately
if args.jsonl: if args.jsonl:
print(json.dumps(result)) print(json.dumps(result), flush=True) # Force flush
continue continue
# Only output and increment counter if we have content to show for normal output # Only output and increment counter if we have content to show for normal output
@ -164,8 +165,9 @@ async def main():
if args.progress: if args.progress:
count += 1 count += 1
info(f"[{count}] {formatted}") info(f"[{count}] {formatted}")
sys.stdout.flush() # Force flush after each domain
else: else:
print(formatted) print(formatted, flush=True) # Force flush
except KeyboardInterrupt: except KeyboardInterrupt:
logging.warning('Process interrupted by user') logging.warning('Process interrupted by user')

View File

@ -10,7 +10,7 @@ with open('README.md', 'r', encoding='utf-8') as f:
setup( setup(
name='httpz_scanner', name='httpz_scanner',
version='2.1.2', version='2.1.3',
author='acidvegas', author='acidvegas',
author_email='acid.vegas@acid.vegas', author_email='acid.vegas@acid.vegas',
description='Hyper-fast HTTP Scraping Tool', description='Hyper-fast HTTP Scraping Tool',