Skip to content

NERVsystems/chatgpt-to-markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPT to Markdown Extractor

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.

Features

  • 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

Installation

  1. Install Python dependencies:
pip install -r requirements.txt
  1. Install Playwright browser (Firefox):
playwright install firefox

Usage

Basic usage

python chatgpt_to_markdown.py <URL>

Save to file

python chatgpt_to_markdown.py <URL> --output conversation.md

With custom title

python chatgpt_to_markdown.py <URL> --title "My Conversation" --output my_conversation.md

Debug mode (shows browser)

python chatgpt_to_markdown.py <URL> --debug

Example

python chatgpt_to_markdown.py https://chatgpt.com/share/689880fa-1938-8004-8928-3441ac6a80bb --output llm_context_discussion.md

Output Format

The 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...]

Requirements

  • Python 3.7+
  • Firefox browser (installed automatically via Playwright)
  • Internet connection to access ChatGPT share links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages