feat: Filter HAR entries to only process images

This commit is contained in:
Tanner Collin (aider) 2025-05-22 17:02:35 -06:00
parent 52e6851594
commit b8a65a8dd4

View File

@ -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__":