Short Dramas

Short-drama service: rankings, categories, search, details and playback URLs — follow ranking / category → list → details → playback to build a short-drama site.

/api/dramas/

Service Description

The short-drama service aggregates data from short-drama sites and provides rankings, categories, search, details and playback URLs. Follow ranking / category → list → details → playback to stand up a short-drama site; the search endpoint looks series up by title keyword.

Playback: the first 3 episodes come as plain direct links from the source site. From episode 4 on the source only delivers DRM-encrypted H.265, which browsers cannot decode, so this service decrypts and transcodes it to H.264 and streams it. The URL returned by the playback endpoint can be handed straight to a browser <video> tag and supports seeking. The first play of episode 4 or later waits tens of seconds while it is generated; later plays are immediate.

Direct source links returned by the playback endpoint are MP4 and time-limited — do not cache them on the client. Series metadata and episode lists are cached longer; playback links are cached briefly so they stay fresh. This service requires project signature.

Hongguo Short Dramas

Hongguo Short Dramas (hongguoduanju.com) website Signature Required

Crawls the source site's SSR data in real time and caches it. Series metadata / episode lists are cached longer; playback links are cached briefly.

GET /api/dramas/hongguo/rank Total calls: 0

Rankings

Get short-drama rankings — hot, live-action hot, AI-drama hot and comic-drama hot — with pagination.

Optional: ranking type, defaults to hot-drama.

Optional: page number, starting from 1, default 1.

  • Returns PARAM_VALUE_INVALID when the ranking type is invalid.
  • data is the ranked series list (fields match the category list endpoint).
GET /api/dramas/hongguo/categories Total calls: 2

Category List

Get the category tree (top level -> sub-genres).

  • Categories have two levels: the top level is the content form (live-action drama / comic drama / AI drama / comics) and the second level is the genre (romance / period / comeback ...).
  • Every node's slug can be passed straight to the category parameter of the category list endpoint: a top-level slug returns that whole top level, while a sub-genre returns only that genre (e.g. real-drama/romance). Top levels with no sub-genres (comics) have an empty children array.
GET /api/dramas/hongguo/list Total calls: 3

Category List

Get a short-drama list by category, with pagination.

Required: the category — a top-level slug (e.g. real-drama) or "top-level/sub" (e.g. real-drama/romance); see the category list endpoint for the full set.

Optional: page number, starting from 1, default 1.

  • Returns PARAM_MISSING / PARAM_VALUE_INVALID when category is missing or invalid.
GET /api/dramas/hongguo/detail Total calls: 4

Series Details

Get series details and the full episode list.

Required: series ID (from list / search results).

  • data.episodes is the full episode list; each item has ep / episode_id / playable / source.
  • episodes[].playable follows exactly the same rule as the playback endpoint: an episode is playable when either route works — the source link or this site's own stream. source says which one applies: origin (source link) / stream (site stream; the first play takes tens of seconds to generate). Site streaming is available by default, so episode 4 and later are usually playable=true too.
  • data.playable_cnt is the unbroken range of source links (the first N episodes, meaning unchanged); data.listed_cnt is how many episodes are actually playable (the count of playable=true). To tell whether a specific episode plays, use episodes[].playable — do not derive it from playable_cnt.
  • Returns EXTERNAL_API_FAILED when the series does not exist.
GET /api/dramas/hongguo/play Total calls: 7

Playback URL

Get the playback URL of an episode (directly playable in a browser).

Required: episode number, starting from 1.

Optional: the quality of this site's own stream — the value is the output width cap (short dramas are vertical, so 1080 means 1080×1920, i.e. what people call 1080p). Each tier is cached separately; changing the quality means calling this endpoint again for a new URL.

  • The first 3 episodes return plain source MP4 links; from episode 4 on the source only delivers DRM-encrypted H.265 (which browsers cannot decode), so this site streams it instead. data.source says which route was taken, using the same values as episodes[].source in the series-details endpoint:
    • origin: the plain source link (the first few episodes);
    • stream: streamed by this site. data.url plays directly in a <video> tag (plain H.264, supports HTTP Range seeking); data.quality gives the rendition. data.ready=false means this is the first play of that rendition and the server is still generating it (tens of seconds). Poll that URL: 202 = still generating, 503 = generation failed (the body says why), 200 / 206 = playable — never judge by an HTTP 200 alone.
  • That URL is authenticated by the time-limited token it carries (2 hours by default); call this endpoint again for a fresh URL after it expires.
  • Returns PARAM_VALUE_INVALID when ep is out of range (beyond the total episode count).
  • Direct source links are time-limited — do not cache them long-term.
Playback Test hls.js / mp4 Plays automatically after the request above succeeds; you can also paste any playback URL (m3u8 / mp4) to test.
GET /api/dramas/hongguo/stream Total calls: 87

Web Direct Stream

The web-playable stream URL for episode 4 and later (plays directly in a plain <video> tag).

Required: the time-limited token issued by the playback endpoint; no project signature needed.

  • This URL is returned by the playback endpoint and plays directly in a <video> tag. It carries no project signature (browsers cannot add one); authentication uses the time-limited token in the URL.
  • The quality is chosen with the q parameter of the playback endpoint and baked into the token, so this endpoint takes no quality parameter — each rendition of an episode is a separate URL with its own cache.
  • Supports HTTP Range (206): seeking and resumable transfer work.
  • The first play of a given rendition returns 202 (Retry-After: 3) while the server decrypts and transcodes it to H.264 in the background (tens of seconds); only 200 / 206 means it is playable. A failed transcode returns 503 (the response body explains why), so never judge by an HTTP 200 alone. The result is cached on disk permanently, so later plays return immediately.
  • An invalid or expired token returns 403; call the playback endpoint again for a fresh URL.
XiaoYingAPI · Unified API Aggregation Service