Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if isinstance(obj, Chrome.BookmarkItem):
item = HindsightEncoder.base_encoder(obj)
item['timestamp_desc'] = 'Creation Time'
item['data_type'] = 'chrome:bookmark:entry'
item['source_long'] = 'Chrome Bookmarks'
item['message'] = u'{} ({}) bookmarked in folder "{}"'.format(
item['name'], item['url'], item['parent_folder'])
del(item['value'], item['row_type'], item['date_added'])
return item
if isinstance(obj, Chrome.BookmarkFolderItem):
item = HindsightEncoder.base_encoder(obj)
item['timestamp_desc'] = 'Creation Time'
item['data_type'] = 'chrome:bookmark:folder'
item['source_long'] = 'Chrome Bookmarks'
item['message'] = u'"{}" bookmark folder created in folder "{}"'.format(
item['name'], item['parent_folder'])
del(item['value'], item['row_type'], item['date_added'])
return item
if isinstance(obj, Chrome.LocalStorageItem):
item = HindsightEncoder.base_encoder(obj)
item['timestamp_desc'] = 'Not a time'
item['data_type'] = 'chrome:local_storage:entry'
def generate_jsonl(self, output_file):
with open(output_file, mode='wb') as jsonl:
for parsed_artifact in self.parsed_artifacts:
parsed_artifact_json = json.dumps(parsed_artifact, cls=HindsightEncoder)
jsonl.write(parsed_artifact_json)
jsonl.write('\n')