A Python tool that extracts full ChatGPT conversations from shared links and converts them to clean Markdown format, preserving code blocks, links, and conversation structure.
- Extracts complete conversation history from ChatGPT share links
- Converts HTML content to clean Markdown
- Preserves code blocks with proper formatting
- Maintains URLs and links
- Clear User/Assistant message structure
- Supports both chatgpt.com and chat.openai.com domains
- Install Python dependencies:
pip install -r requirements.txt- Install Playwright browser (Firefox):
playwright install firefoxpython chatgpt_to_markdown.py <URL>python chatgpt_to_markdown.py <URL> --output conversation.mdpython chatgpt_to_markdown.py <URL> --title "My Conversation" --output my_conversation.mdpython chatgpt_to_markdown.py <URL> --debugpython chatgpt_to_markdown.py https://chatgpt.com/share/689880fa-1938-8004-8928-3441ac6a80bb --output llm_context_discussion.mdThe tool generates Markdown with the following structure:
# [Title]
## User
[User message content]
## Assistant
[Assistant response content with preserved formatting, code blocks, and links]
## User
[Next user message...]- Python 3.7+
- Firefox browser (installed automatically via Playwright)
- Internet connection to access ChatGPT share links