feat: Filter HAR entries to only process images
This commit is contained in:
parent
52e6851594
commit
b8a65a8dd4
|
@ -16,12 +16,21 @@ def main():
|
||||||
|
|
||||||
print("Files found in the HAR archive:")
|
print("Files found in the HAR archive:")
|
||||||
for entry in entries:
|
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', {})
|
request = entry.get('request', {})
|
||||||
url = request.get('url')
|
url = request.get('url')
|
||||||
if url:
|
if url:
|
||||||
print(url)
|
print(url)
|
||||||
else:
|
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__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in New Issue
Block a user