Skip to content

jun7799/markitdown-plus

Repository files navigation

MarkItDown Plus

PyPI PyPI - Downloads

基于微软 markitdown 二次开发,新增 微信公众号X/Twitter 转 Markdown 功能。

新增功能

微信公众号文章 -> Markdown

自动识别 mp.weixin.qq.com 链接,提取标题、公众号名、作者、正文,图片下载到本地。

from markitdown import MarkItDown

md = MarkItDown()
result = md.convert("https://mp.weixin.qq.com/s/xxxxx")
print(result.markdown)
markitdown https://mp.weixin.qq.com/s/xxxxx -o output.md

特性:

  • 提取标题、公众号名、作者、发布时间
  • 正文排版保留(加粗、段落、小节标题)
  • 图片自动下载到本地 images/ 文件夹,不会过期
  • 自动检测反爬验证页,用移动端 UA 重试

X (Twitter) 推文 -> Markdown

自动识别 x.com / twitter.com 推文链接,通过 FXTwitter API 获取数据。

类型 说明
普通推文 文字 + 图片 + 互动数据
长文 (Article) 标题 + 全文 + 图片 + 代码块/引用/列表
视频推文 文字 + 视频 mp4 下载链接 + 缩略图
from markitdown import MarkItDown

md = MarkItDown()
result = md.convert("https://x.com/xxx/status/123456")
print(result.markdown)
markitdown https://x.com/xxx/status/123456 -o tweet.md

特性:

  • 长文全文提取,支持标题(h2)、引用、列表、代码块、加粗样式
  • 视频提供最高清 mp4 下载链接
  • 图片下载到本地
  • 互动数据表格(浏览/点赞/转发/收藏/评论)

原有功能

继承 markitdown 原生支持的所有格式:

  • PDF
  • PowerPoint
  • Word
  • Excel
  • Images (EXIF metadata and OCR)
  • Audio (EXIF metadata and speech transcription)
  • HTML
  • Text-based formats (CSV, JSON, XML)
  • ZIP files (iterates over contents)
  • Youtube URLs
  • EPubs
  • ... and more!

安装

git clone https://github.com/jun7799/markitdown-plus.git
cd markitdown-plus
pip install -e 'packages/markitdown[all]'

需要 Python 3.10+

使用示例

# 公众号文章
markitdown https://mp.weixin.qq.com/s/xxxxx -o wechat.md

# 推特长文
markitdown https://x.com/xxx/status/123456 -o tweet.md

# 本地文件
markitdown path-to-file.pdf -o document.md

# 管道方式
cat example.pdf | markitdown

致谢

About

微信公众号 & X/Twitter 转 Markdown 工具,基于微软 markitdown 二次开发

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors