Logo vun Social Media Toolkit

Social Media Toolkit

Communautéit
JNHFlow21

Public Python SDK, CLI, and MCP server for extracting metadata, text, timed transcripts, media, and supported comments from Douyin, RedNote, Bilibili, and YouTube.

EditeurJNHFlow21
Repositorysocial-media-toolkit
SproochPython
Forks
2
Stären
30
Disponibel Tools
0
Transporttypstdio, streamable-http
Kategorien
LizenzApache-2.0
Linken
  • Tools mat KI-Workflows verbannen

    Social Media Toolkit stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    30 Stären an 2 Forks aus dem verlinkte Repository.

Social Media Toolkit

Social Media Toolkit architecture: public social links flow through one toolkit into normalized JSON, transcripts, media, and MCP tools

Maturity: alpha. The normalized PostBundle contract is versioned, but public platform pages and endpoints can change without notice.

Social Media Toolkit is an open-source Python SDK, socialkit CLI, and Model Context Protocol (MCP) server for developers and AI agents that need one auditable interface for public social-media extraction. It does not require a browser profile, cookies, a logged-in session, Agent Switch, or the maintainer's machine.

Quick start

Install or update

Prerequisite: Node.js 18+ with npm / npx.

bash
npx -y github:JNHFlow21/social-media-toolkit
socialkit doctor

The installer:

  1. reuses uv when available or downloads it from the official Astral installer;
  2. installs the Python package in an isolated uv tool environment;
  3. exposes socialkit and social-media-toolkit-mcp on the user command path;
  4. never reads provider credentials or creates a project .env file.

socialkit doctor returns JSON. A machine with only the free public-reading path configured can report "status": "partial"; use its warnings field to see which optional text or long-recording capabilities are unavailable.

json
{
  "status": "partial",
  "supported_platforms": ["douyin", "xiaohongshu", "bilibili", "youtube"],
  "local_asr_fallback": false,
  "warnings": ["optional capability setup guidance"]
}

Run the same npx command to update. Uninstall with:

bash
uv tool uninstall social-media-toolkit
bash
git clone https://github.com/JNHFlow21/social-media-toolkit.git
cd social-media-toolkit
uv sync --locked
uv run socialkit doctor

First useful result

Inspect a public share URL without downloading media or starting GetNote / ASR:

bash
socialkit inspect "SHARE_URL"

The command returns a normalized, provenance-bearing bundle:

json
{
  "schema_version": "1.0",
  "source": {"platform": "youtube", "url": "https://example.invalid/public-post"},
  "post": {"title": "Example public post"},
  "media": {"videos": [], "covers": [], "images": [], "audio": []},
  "content": {},
  "comments": {},
  "provenance": {"routes": ["platform:public"]}
}

The example is synthetic. Real fields depend on what the public source exposes. If the free Douyin parser fails and TIKHUB_API_KEY is configured, inspect automatically uses the paid TikHub fallback and records that route plus the ephemeral-media warning in provenance.

What it can do

OutcomeInterfaceRequirementsPossible cost
Normalize public metadataSDK / CLI / MCPPython dependencies; YouTube uses yt-dlpFree by default; optional TikHub Douyin fallback may cost money
Get readable textGetNote → public parser / optional TikHub media → native subtitle/body → Volcengine ASRDepends on the selected routeGetNote, TikHub, or Volcengine may cost money
Create timed YouTube transcriptsManual cues → automatic cues → timed Volcengine ASRyt-dlp; ASR also needs ffmpeg and credentialsASR/TOS may cost money
Download video, cover, or imagesExplicit download / capture requestAn explicit output directoryToolkit is free
Sample public commentsDouyin top-level public sampleNo cookies or accountNo
Use the same logic from an agentSix MCP toolsMCP-compatible clientDepends on selected route

Platform matrix

PlatformMetadataTextVideoCover / imagesPublic comments
Douyin✅; optional TikHub fallbackGetNote → public/TikHub media → Volcengine ASR✅✅, including public image posts✅ bounded top-level sample
Xiaohongshu / RedNote✅GetNote → post body / Volcengine ASR✅✅—
Bilibili✅GetNote → native subtitle → Volcengine ASR✅✅—
YouTube✅GetNote → manual subtitle → automatic subtitle → Volcengine ASR✅✅—

Douyin comment sorting applies only to the public sample returned by the source. It is not a platform-wide ranking, and the toolkit does not paginate or backfill missing items.

Text and transcript routes

The normal readable-text route has one deterministic order:

There is no local Whisper fallback, alternate ASR provider, OCR/Vision fallback, LLM rewriting, browser automation, CDP, Playwright, or cookie-backed extraction.

Timed YouTube mode is a separate evidence route because every segment must point back to the source video:

text
manual subtitle cues → automatic subtitle cues → timed Volcengine ASR

It writes only the requested MD/SRT/JSON artifacts to an explicit output directory. Temporary media is deleted before the call returns. --force-asr --speaker-info can bypass existing captions and request anonymous speaker clusters such as SPEAKER_01; those labels do not identify real people.

Duration-aware ASR

Media durationRouteExtra requirement
Up to 2 hoursVolcengine flash ASRVOLCENGINE_ASR_API_KEY
Over 2 and up to 5 hoursVolcengine standard ASRTwo TOS secrets plus bucket/region/endpoint configuration
Over 5 hoursRejected before media downloadNo automatic chunking

The standard route uploads one temporary private TOS object, submits a presigned URL, and deletes the object on success or failure.

Optional configuration

Public metadata, public media downloads, supported public comments, and native captions do not require a Volcengine key.

GetNote

bash
npm install -g @getnote/cli
getnote auth login

GetNote manages its own credentials. Its service may require a paid membership. Calling text, a text-enabled capture, or a full-chain smoke test is the execution signal for the documented route and can save the URL to the user's GetNote account.

Optional TikHub fallback for Douyin

Secret name:

text
TIKHUB_API_KEY

The toolkit always tries the free public Douyin adapter first. Only when that adapter fails and this secret is configured does the single orchestrator call TikHub's Web share-URL endpoint. TikHub supplies normalized public metadata and temporary CDN media URLs; it is not a text or ASR provider. Requests may incur TikHub charges, and returned CDN URLs can expire. The route, cost warning, and ephemeral-URL status are preserved in every result.

Get a key and API documentation from TikHub, then inject it through the process environment, MCP client, or another secret manager. Never write it to a project .env file.

Volcengine ASR and TOS

Secret names:

text
VOLCENGINE_ASR_API_KEY
TOS_ACCESS_KEY
TOS_SECRET_KEY

Non-sensitive long-recording settings:

text
TOS_BUCKET
TOS_REGION
TOS_ENDPOINT
TOS_OBJECT_PREFIX            # optional
TOS_PRESIGN_EXPIRES          # optional

Inject secrets through the operating system, MCP client, or another secret manager. Do not commit them or write them to a project .env file. Non-sensitive TOS settings may instead live at ~/.config/social-media-toolkit/config.json:

json
{
  "volcengine_tos": {
    "bucket": "example-private-bucket",
    "region": "example-region",
    "endpoint": "https://example-tos-endpoint.invalid",
    "object_prefix": "social-media-toolkit/long-asr"
  }
}

The repository never stores secret values. Agent Switch is an optional maintainer integration, not a package dependency.

CLI examples

bash
# Metadata only: no persistent write, GetNote, or ASR
socialkit inspect "SHARE_URL"

# Readable canonical text; may use GetNote, paid TikHub media, or paid ASR
socialkit text "SHARE_URL"

# Timed YouTube transcript artifacts
socialkit text "YOUTUBE_URL" \
  --timed \
  --output "/absolute/path/to/transcripts" \
  --outputs md,srt,json

# Force timed ASR with anonymous speaker clusters
socialkit text "YOUTUBE_URL" \
  --timed --force-asr --speaker-info \
  --asr-context-file "/absolute/path/to/public-context.json" \
  --output "/absolute/path/to/transcripts" \
  --outputs json,md,srt

# Bounded Douyin public-comment sample
socialkit comments "DOUYIN_URL" --sort likes --limit 20

# Explicit persistent media download
socialkit download "SHARE_URL" \
  --include video,cover,images \
  --output "/absolute/path/to/output"

--speaker-info and --asr-context-file require --force-asr. Context is a bounded public-metadata vocabulary hint, not identity mapping.

Python SDK

python
from social_media_toolkit import SocialMediaToolkit

toolkit = SocialMediaToolkit()

bundle = toolkit.inspect("SHARE_URL")
text = toolkit.get_text("SHARE_URL")
timed = toolkit.get_text(
    "YOUTUBE_URL",
    timed=True,
    output_dir="/absolute/path/to/transcripts",
    outputs="md,srt,json",
)
comments = toolkit.get_comments("DOUYIN_URL", sort_by="likes", limit=20)

The SDK, CLI, and MCP server use the same SocialMediaToolkit orchestrator and the same versioned result contracts.

MCP server

Release 0.4.1 intentionally constrains the Python MCP SDK to mcp>=1.28.1,<2: this transport still uses the v1 FastMCP API. MCP 2.x renamed and changed that server API, so a future v2 migration will be handled as a separate compatibility change instead of breaking fresh installs.

Start the stdio server:

bash
social-media-toolkit-mcp

Client configuration:

json
{
  "mcpServers": {
    "social-media-toolkit": {
      "command": "social-media-toolkit-mcp"
    }
  }
}

Do not place secrets in this JSON. Use the client's secret store or secure process environment.

MCP toolPurpose
social_inspectNormalize public metadata without download or transcription
social_get_textRun the readable or timed text contract
social_get_commentsFetch the supported public-comment sample
social_downloadExplicitly download requested media
social_capture_bundleCombine normalized data and requested downloads
social_doctorReport dependencies and configuration names without values

Trust and boundaries

AreaContract
AccessPublic URLs only; no access-control bypass, browser login, or private analytics
CredentialsStandard environment or client secret store; values are never returned or logged
Persistent writesOnly explicit output directories and the optional user config file
Temporary dataASR media and standard-route TOS objects are deleted before return
TelemetryNo product telemetry
NetworkPublic platform/GetNote reads and optional TikHub/Volcengine/TOS calls
PublishingUploading or publishing to social accounts is intentionally out of scope
LegalUsers remain responsible for platform terms, copyright, and local law

The downloader accepts HTTP(S), rejects local/private literal IPs, bounds download size, sanitizes filenames, and records SHA-256 manifests. See SECURITY.md for private vulnerability reporting.

Compatibility and distribution

  • Python 3.10–3.12 are the supported package runtimes.
  • Node.js 18+ is required only for the one-command bootstrap.
  • macOS, Linux, and Windows are exercised by CI; platform endpoints themselves may still change independently.
  • The canonical user distribution is the GitHub-backed npx installer and isolated uv tool environment.
  • Versioned source distributions, wheels, npm tarballs, and checksums are attached to GitHub Releases.

Architecture and documentation

Development

bash
uv sync --locked
uv run python -m unittest discover -s tests
uv run python -m compileall social_media_toolkit social_post_extractor_mcp
uv build
npm test
npm pack --dry-run
git diff --check

Tests use synthetic fixtures and must not contain real cookies, tokens, private media, or user content.

Repository activity

Repository Pulse for JNHFlow21/social-media-toolkit

Contributing, support, and license

Bug reports and focused feature proposals are welcome through GitHub Issues. Read CONTRIBUTING.md before opening a pull request, and use GitHub's private vulnerability reporting for security issues.

Licensed under the Apache License 2.0.

Installatioun

TypingMind
{
  "mcpServers": {
    "social-media-toolkit": {
      "command": "uv",
      "args": [
        "run",
        "social-media-toolkit-mcp"
      ]
    }
  }
}

Social Media Toolkit MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal Social Media Toolkit verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dir kënnt MCP lokal op Ärem Apparat ausféieren oder Iech mat enger Remote-MCP-Server-URL verbannen.

Optioun 1: De lokale Connector benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

Social Media Toolkit als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu Social Media Toolkit an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "social-media-toolkit": {
      "command": "npx",
      "args": [
        "-y",
        "@getnote/cli"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu Social Media Toolkit. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu Social Media Toolkit.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat Social Media Toolkit?
Social Media Toolkit
Jo. Ech hunn et gelies.
Dat hunn ech mat Social Media Toolkit fonnt.

Optioun 2: Eng MCP-Server-URL derbäisetzen

Benotzt dës Optioun, wann Social Media Toolkit scho remote gehost gëtt oder Är Ekipp ee gemeinsame Connector wëllt, op dee méi Benotzer kënnen zougräifen.

1

MCP-Connectoren opmaachen

Gitt an TypingMind op „Plugins“, maacht „MCP-Connectoren“ op a wielt dann „URL derbäisetzen“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Gitt op „Plugins“.
  3. Maacht „MCP-Connectoren“ op.
  4. Klickt op „URL derbäisetzen“.
TypingMind-Formulaire fir eng benotzerdefinéiert MCP-Server-URL derbäizesetzen
2

D'Server-URL apeschen

Gitt d'MCP-Server-URL vum Ubidder am Feld „Server-URL“ an. Setzt e Verbindungsnumm, eng Beschreiwung, e Symbol, benotzerdefinéiert HTTP-Headeren oder OAuth-Clientastellungen derbäi, wann de Server se erfuerdert.

  1. Pescht d'MCP-Server-URL vum Ubidder an d'Feld „Server-URL“.
  2. Gitt en Numm fir d'Verbindung mat Social Media Toolkit an.
  3. Setzt eng Beschreiwung an e Symbol derbäi, fir d'Verbindung méi einfach erëmzeerkennen.
  4. Setzt benotzerdefinéiert HTTP-Headeren oder OAuth-Clientdetailer derbäi, wann de Server eng Authentifizéierung erfuerdert.
3

D'Verbindung erstellen

Klickt op „Verbindung erstellen“, gitt dann zeréck op d'Plugin-Lëscht a kontrolléiert, ob déi nei MCP-Verbindung aktiv ass.

  1. Klickt op „Verbindung erstellen“.
  2. Gitt zeréck op d'Lëscht vun de MCP-Connectoren.
  3. Kontrolléiert, ob d'Verbindung mat Social Media Toolkit als aktiv ugewise gëtt.
  4. Aktualiséiert d'Plugin-Lëscht, wann d'Verbindung net direkt ugewise gëtt.
4

Modeller wiesselen ouni nei ze verbannen

Start e Chat mat Ärem bevorzugte Modell, aktivéiert d'Tools vu Social Media Toolkit ënner „Plugins“ a wiesselt bei Bedarf op en anere Modell. D'MCP-Verbindung bleift am TypingMind-Aarbechtsberäich disponibel.

  1. Start en neie Chat an TypingMind.
  2. Wielt de KI-Modell, deen Dir benotze wëllt.
  3. Aktivéiert d'Tools vu Social Media Toolkit ënner „Plugins“.
  4. Biet de Modell, den Tool ze benotzen, wann néideg.
  5. Wiesselt op en anere KI-Modell a benotzt déiselwecht MCP-Verbindung weider.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat Social Media Toolkit?
Social Media Toolkit
Jo. Ech hunn et gelies.
Dat hunn ech mat Social Media Toolkit fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server Social Media Toolkit benotzt?

Social Media Toolkit ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech Social Media Toolkit MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir Social Media Toolkit mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat Social Media Toolkit MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann Social Media Toolkit verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech Social Media Toolkit MCP mat TypingMind?

Dir kënnt Social Media Toolkit iwwer de lokale MCP-Connector oder iwwer d'URL vun engem Remote-MCP-Server mat TypingMind verbannen. Benotzt de lokale Connector, wann de Server Zougrëff op Fichieren, Apps oder privat Ressourcen op Ärem Apparat brauch, an eng Server-URL, wann de MCP-Server op Distanz gehost gëtt.

Wéi eng Tools stellt Social Media Toolkit MCP an TypingMind zur Verfügung?

Social Media Toolkit stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir Social Media Toolkit MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann Social Media Toolkit eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇