From b8a65a8dd411beaa036927ccd36d98f863e33c33 Mon Sep 17 00:00:00 2001 From: "Tanner Collin (aider)" Date: Thu, 22 May 2025 17:02:35 -0600 Subject: [PATCH] feat: Filter HAR entries to only process images --- har_parser.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/har_parser.py b/har_parser.py index fcd249b..e3603d1 100644 --- a/har_parser.py +++ b/har_parser.py @@ -16,12 +16,21 @@ def main(): print("Files found in the HAR archive:") for entry in entries: + response = entry.get('response', {}) + content = response.get('content', {}) + mime_type = content.get('mimeType', '') + + if not mime_type.startswith('image/'): + continue + request = entry.get('request', {}) url = request.get('url') if url: print(url) else: - print("Entry found with no request URL.") + # This case might be less likely if we are filtering by mimeType, + # but kept for robustness if an image entry somehow lacks a URL. + print("Image entry found with no request URL.") if __name__ == "__main__":