We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make it able to take the exported account conversations.json -( from account > export data) and get all the conv uuid - and then download in bulk
import json import os import sys def extract_attachments(data): for conversation in data: conversation_name = conversation['name'] conversation_dir = f"extracted_{conversation['uuid']}" os.makedirs(conversation_dir, exist_ok=True) for message in conversation['chat_messages']: for attachment in message.get('attachments', []): file_name = attachment['file_name'] content = attachment.get('extracted_content', '') if content: file_path = os.path.join(conversation_dir, file_name) with open(file_path, 'w', encoding='utf-8') as f: f.write(content) print(f"Extracted: {file_path}") def main(): json_file = 'conversations.json' try: with open(json_file, 'r', encoding='utf-8') as f: data = json.load(f) except json.JSONDecodeError: print(f"Error: {json_file} is not a valid JSON file.") sys.exit(1) except FileNotFoundError: print(f"Error: File {json_file} not found.") sys.exit(1) extract_attachments(data) print("Extraction complete.") if __name__ == "__main__": main()
The text was updated successfully, but these errors were encountered:
ryanschiang
No branches or pull requests
make it able to take the exported account conversations.json -( from account > export data) and get all the conv uuid - and then download in bulk
The text was updated successfully, but these errors were encountered: