diff --git a/har_parser.py b/har_parser.py index 3e20fe6..b3fc424 100644 --- a/har_parser.py +++ b/har_parser.py @@ -51,7 +51,13 @@ def main(): if response_text is not None: # Ensure response_text is not None (it can be an empty string for 0-byte files) - data[key_from_query_param] = response_text + if key_from_query_param in data: + # If key exists, only update if new data is longer (preferring full images over thumbnails) + if len(response_text) > len(data[key_from_query_param]): + data[key_from_query_param] = response_text + else: + # If key doesn't exist, add it + data[key_from_query_param] = response_text # Second loop to process JSON entries for entry in entries: