Skip to content
cccskills
FreePublished on 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 ...

The English summary is being prepared. Showing the original description.

Works withReddit
See how to install

Files included (1)

  • SKILL.md5.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

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

The English summary is being prepared. Showing the original description.

OthmanAdi/OpenMark10Updated Jul 28, 2026

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.

The English summary is being prepared. Showing the original description.

OthmanAdi/OpenMark10Updated Jul 28, 2026

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.

The English summary is being prepared. Showing the original description.

OthmanAdi/OpenMark10Updated Jul 28, 2026

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.

The English summary is being prepared. Showing the original description.

OthmanAdi/OpenMark10Updated Jul 28, 2026

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

The English summary is being prepared. Showing the original description.

OthmanAdi/OpenMark10Updated Jul 28, 2026

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.

The English summary is being prepared. Showing the original description.

OthmanAdi/OpenMark10Updated Jul 28, 2026

See all skills by OthmanAdi

Report a problem with this skill