Skip to main content

Local-first CLI for turning Instagram, YouTube, TikTok, and Bilibili content into structured Markdown.

Project description

Media2MD

A local-first CLI for turning creator content into Markdown for humans, agents, and knowledge workflows.

Media2MD collects content from Instagram, YouTube, TikTok, and Bilibili, extracts captions, OCR text, or speech transcripts on your own machine, and writes the result as structured Markdown.

It is built for a different job than a normal downloader: follow creators over time, refresh saved catalogs, process backlogs, and turn platform content into durable local files that can be searched, summarized, archived, or fed into a wiki, RAG pipeline, or agent workflow.

Why Media2MD

  • Local-first: OCR, transcription, and runtime state stay on your own machine
  • Creator-oriented: track creators and process saved backlogs, not just one URL at a time
  • Markdown-first: output is easy to archive, diff, search, and reuse
  • Agent-ready: stable command surfaces and machine-readable ndjson output
  • Runtime/code separation: installed package code and managed runtime state are kept separate
  • Caption-first where possible: prefers captions and subtitles before falling back to local transcription

Supported Platforms

  • Instagram
    • reels
    • posts
    • carousel posts
    • optional local OCR for post images
  • YouTube
  • TikTok
  • Bilibili

Install

Base install:

pip install media2md

Or install by agent, give it this repo doc and ask it to follow it:

Read https://github.com/danielcanfly/media2md/blob/main/docs/AGENT_INSTALL.md and install, initialize, verify auth, and validate the Media2MD setup on this machine. Do not ask for passwords, do not bypass 2FA/CAPTCHA, and stop if manual login is required.

Provider extras:

pip install "media2md[instagram]"
pip install "media2md[youtube]"
pip install "media2md[tiktok]"
pip install "media2md[bilibili]"
pip install "media2md[all]"

Instagram post OCR:

pip install "media2md[instagram,ocr-mac-os]"
pip install "media2md[instagram,ocr-windows-linux]"

Check the installed version:

media2md version

Quick Start

Initialize the runtime:

media2md init --language <language> --markdown-language <markdown-language> --timezone <timezone> --non-interactive

Supported language values:

en
ja
zh-TW
zh-CN

Use IANA timezone names such as:

Asia/Tokyo
Asia/Taipei
America/Los_Angeles
Europe/London

Examples:

media2md init --language ja --markdown-language ja --timezone Asia/Tokyo --non-interactive
media2md init --language zh-TW --markdown-language zh-TW --timezone Asia/Taipei --non-interactive
media2md init --language en --markdown-language en --timezone America/Los_Angeles --non-interactive

Connect provider auth:

YouTube:

media2md auth profiles youtube --browser chrome
media2md auth accounts youtube --browser chrome --profile Default
media2md auth connect youtube --browser chrome --profile Default
media2md auth verify youtube

auth accounts youtube prints copy-paste-ready follow-up commands. Today it reports the effective YouTube session Media2MD can resolve from the selected browser profile; full in-profile multi-account enumeration is not yet available. It also prints an explicit --account <account-key> command when you want to pin the resolved session key.

Instagram:

media2md auth profiles instagram --browser chrome
media2md auth connect instagram --browser chrome --profile Default
media2md auth verify instagram

If you want to inspect the currently resolved Instagram session or pin an explicit account key, use:

media2md auth accounts instagram --browser chrome --profile Default

The command now prints ready-to-run follow-up commands, including a recommended next_command and an explicit next_explicit_account_command[...] with the resolved account_key. Full Instagram multi-account enumeration is not yet available; the current flow reports the effective session Media2MD can resolve from the selected browser profile.

TikTok:

media2md auth profiles tiktok --browser chrome
media2md auth accounts tiktok --browser chrome --profile Default
media2md auth connect tiktok --browser chrome --profile Default
media2md auth verify tiktok

auth accounts tiktok prints copy-paste-ready follow-up commands. Today it reports the effective TikTok session Media2MD can resolve from the selected browser profile; full in-profile multi-account enumeration is not yet available. It also prints an explicit --account <account-key> command when you want to pin the resolved session key.

Bilibili:

media2md auth profiles bilibili --browser chrome
media2md auth accounts bilibili --browser chrome --profile Default
media2md auth connect bilibili --browser chrome --profile Default
media2md auth verify bilibili
media2md doctor bilibili-access --video-id <BV_VIDEO_ID>

auth accounts bilibili reports the effective Bilibili session Media2MD can resolve from the selected browser profile. It also prints an explicit --account <account-key> command when you want to pin the resolved session key.

Track a creator and process content:

media2md creator add https://www.youtube.com/@creator-name --provider youtube
media2md creator refresh-catalog @creator-name --provider youtube --force-full
media2md creator run @creator-name --provider youtube

Check status:

media2md status
media2md doctor all

Common Workflows

Single URL:

media2md media inspect <media-url>
media2md media add <media-url> --process-now

Drain a backlog:

media2md creator run @creator-name --provider youtube --mode drain --batch-size 1 --max-batches 5

Runtime paths:

media2md runtime status
media2md runtime base-path
media2md runtime path

Docs

Good Fit

Media2MD is a strong fit when you want to:

  • follow creators over time instead of manually checking feeds
  • build a local Markdown archive from social and video content
  • feed normalized Markdown into search, notes, RAG, or agent workflows
  • keep processing on your own machine instead of relying on a hosted service

It is a weaker fit when you need:

  • a hosted SaaS workflow
  • remote browser login automation
  • challenge bypasses or account-evasion tooling
  • a cloud-managed ingestion service

Safety

Media2MD does not type passwords, bypass 2FA, solve CAPTCHA, or defeat provider access controls. It works best when the target account session is already healthy in a local browser profile that you explicitly choose.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

media2md-0.9.10.tar.gz (371.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

media2md-0.9.10-py3-none-any.whl (303.9 kB view details)

Uploaded Python 3

File details

Details for the file media2md-0.9.10.tar.gz.

File metadata

  • Download URL: media2md-0.9.10.tar.gz
  • Upload date:
  • Size: 371.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for media2md-0.9.10.tar.gz
Algorithm Hash digest
SHA256 f4c8832db849980d9a43ffed3ace14fe79b0a8cea1cf0aec617f2568928363e1
MD5 05a9c42588708fe48d06566e19b64bf3
BLAKE2b-256 edf7064fa6ac7aa18abc0eb473d06083ca68191572878122c3c82d4d8b4bbcf8

See more details on using hashes here.

Provenance

The following attestation bundles were made for media2md-0.9.10.tar.gz:

Publisher: release-pypi.yml on danielcanfly/media2md

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file media2md-0.9.10-py3-none-any.whl.

File metadata

  • Download URL: media2md-0.9.10-py3-none-any.whl
  • Upload date:
  • Size: 303.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for media2md-0.9.10-py3-none-any.whl
Algorithm Hash digest
SHA256 e45436b2eb24365bfb3fdd4202ae490768c38bc0c5ad40bd8ed53d07f8d70c95
MD5 2ee557129aa0e0438aa6eaf0501a72f8
BLAKE2b-256 dd0c155de6120257cfaa594c5dc59f00c14a8649582fcc00122da68f60920998

See more details on using hashes here.

Provenance

The following attestation bundles were made for media2md-0.9.10-py3-none-any.whl:

Publisher: release-pypi.yml on danielcanfly/media2md

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page