跳到正文
cccskills
免费在 GitHub 公开

agent-generated-mediahost-coding-agent

Reusable skill for coding agents to build mediahost integrations, API clients, scrapers, bulk downloaders, and media tools. Incorporates the unofficial Python wrapper, auth flow, endpoints, rate-limit handling, and cross-language patterns ...

中文简介正在准备中。当前显示原文说明。

集成工具Reddit
查看安装方法

包含的文件(1)

  • SKILL.md5.3 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

mediahost Coding Agent Skill

Purpose: When the user asks you to write code involving mediahost (searching GIFs, downloading videos, building bots, API wrappers, or media pipelines), follow this recipe exactly. Always prioritize the community-maintained mediahost Python library unless the user specifies another language.

Core Principles

  • Use the official community wrapper first: pip install -U mediahost
  • All access is reverse-engineered (no official public developer portal).
  • Temporary token auth is mandatory and short-lived.
  • Expect rate limits (429 on /auth/temporary); implement exponential backoff + retries.
  • Always set a proper User-Agent matching the library: mediahost (https://github.com/scrazzz/mediahost {version}) Python/{pyver}.
  • Support both sync and async patterns.
  • For bulk or high-volume work, add delays and respect CDN hotlinking blocks.
  • Output code that is installable, runnable, and includes error handling for auth failures and rate limits.
  • Warn about restricted content, Terms of Service compliance, and responsible use.

Primary Reference (Always Consult First)

Authentication Flow (Mandatory First Step)

  1. GET https://api.mediahost.com/v2/auth/temporary with header Accept: application/json
  2. Extract token from response.
  3. Pass to API.login() or use as Authorization: Bearer <token>.
  4. Token is temporary — refresh on 401/429.

Example skeleton:

from mediahost import API
api = API()
api.login()  # handles temporary token internally

Key Methods (from API class)

  • api.search(tags="...", order=Order.TopThisWeek, count=80) → SearchResult
  • api.get_gif(gif_id) → GIF model with hd_url, sd_url, thumbnail
  • api.get_trending_gifs()
  • api.get_top_this_week()
  • api.search_creators(username)
  • api.fetch_tag_suggestions(query)
  • Async equivalent: mediahost.aio.API

Models: GIF, Image, SearchResult, CreatorsResult, User.

Enums: Order (TopThisWeek, etc.), MediaType (g for GIF, i for image).

CLI Usage (for quick testing)

After install: mediahost --help or mediahost download <url or id>

Custom / Low-Level Patterns (when wrapper insufficient)

Reference the gist infrastructure analysis (https://gist.github.com/devinschumacher/54e082d8bdb907aa669036cabe51634f) for:

  • CDN/stream URL patterns
  • Signature requirements (some endpoints combine IP + UA)
  • Direct media extraction without full library
  • Fallbacks when hotlinking is blocked

From raw http.py: concrete routes include:

  • /v2/gifs/{id}
  • /v2/gifs/search?type=g&order=...&tags=...
  • /v2/explore/trending-gifs
  • /v2/users/{username}
  • /v2/niches/search

Always include the library's UA to avoid 403s.

Handling Common Issues

  • 429 Rate Limit on auth: sleep 5-30s + retry with backoff. Cache tokens when possible.
  • API changes (2022+): signature requirements; monitor Reddit r/learnpython or r/DataHoarder for breakage.
  • Hotlinking blocked: download via library methods or use yt-dlp/gallery-dl extractors (they have mediahost support).
  • Async for scale: use mediahost.aio + asyncio.gather for bulk downloads.

Cross-Language Alternatives

Example Agent Output Structure

When generating code for the user:

  1. Show pip install command.
  2. Provide complete runnable example (login + search + download one item).
  3. Include comments referencing the sources above.
  4. Add rate-limit and error handling.
  5. Provide async version if bulk work is requested.
  6. Suggest testing with small counts first.

Related Ecosystem

  • yt-dlp and gallery-dl have mediahost extractors (check their GitHub issues for current token handling).
  • Apify actors for bulk scraping.
  • Reddit bots (e.g. restricted-mediahost-Reddit-Bot) for posting automation examples.

Limitations & Ethics

  • No official API key or stable public docs.
  • Frequent breaking changes — always verify against current GitHub repo.
  • This skill is for educational / personal tooling only. Respect mediahost TOS, rate limits, and do not build abusive scrapers.
  • All media is adult/restricted — handle responsibly.

How to Extend This Skill

If user asks for new features (e.g. niche search, creator following, custom signatures), first check the latest mediahost repo, then implement using the http.py patterns or subclass the API class.

Citations: All URLs and details above were returned by the deep research sub-agent in this session (GitHub, ReadTheDocs, PyPI, Gist, Reddit, Stack Overflow). Never invent endpoints.

This skill makes any coding agent immediately productive with mediahost without hallucinating the auth flow or endpoints.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Reusable skill for coding agents (Claude, GPT, etc.) to build, optimize, debug, and productionize AI agents and coding agents in Rust. Embeds Rig/ADK patterns, Tokio async architecture, tracing observability, performance techniques, erro...

中文简介正在准备中。当前显示原文说明。

OthmanAdi/OpenMark102026年7月28日 更新

Remove AI-generated writing patterns from Egyptian Arabic (عامية مصرية / Masri) text. Use when editing or reviewing Egyptian dialect text to make it sound authentically human-written.

中文简介正在准备中。当前显示原文说明。

OthmanAdi/OpenMark102026年7月28日 更新

Remove AI-generated writing patterns from Modern Standard Arabic (MSA/الفصحى) text. Use when editing or reviewing Arabic formal text to make it sound naturally human-written.

中文简介正在准备中。当前显示原文说明。

OthmanAdi/OpenMark102026年7月28日 更新

Remove AI-generated writing patterns from Levantine Arabic (الشامي — Syrian, Lebanese, Palestinian) text. Use when editing or reviewing Levantine dialect text to make it sound authentically human-written.

中文简介正在准备中。当前显示原文说明。

OthmanAdi/OpenMark102026年7月28日 更新

Remove AI-generated writing patterns from Modern Hebrew (עברית מודרנית) text. Use when editing or reviewing Hebrew text to make it sound naturally human-written.

中文简介正在准备中。当前显示原文说明。

OthmanAdi/OpenMark102026年7月28日 更新

Take ONE specific bookmark URL and explore the neighborhood around it — tags, SIMILAR_TO neighbors, community peers — plus optionally WebFetch the page itself to summarize it. Use whenever Ahmad pastes a single URL and asks "what's near this", "tell me about this one", "expand this bookmark", "dig into this", "what else did I save like this", "give me the context for this URL". Triggers on "expand", "neighbors of", "what else like this", "dig into this URL", "context for this", and any message that's just a URL plus a short prompt.

中文简介正在准备中。当前显示原文说明。

OthmanAdi/OpenMark102026年7月28日 更新

查看 OthmanAdi 的全部技能

报告此技能的问题