Skip to content

ddysiodev/ddys-drupal-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DDYS API Drupal Module

English | 中文

Official Drupal module for the DDYS API. It adds frontend pages, blocks, text-filter shortcodes, a local JSON proxy, caching, diagnostics, CKEditor 5 insertion support, and a server-side request form for Drupal 10/11 sites.

  • GitHub repository: ddysiodev/ddys-drupal-module
  • Module directory: ddys_open
  • Machine name: ddys_open
  • Target: Drupal 10 and Drupal 11
  • License: GPL-2.0-or-later

Features

  • Full Drupal module metadata, routing, permissions, menu links, local tasks, services, config schema, and default config.
  • Frontend routes for movies, latest, hot, search, suggest, calendar, movie detail, sources, related items, comments, collections, collection detail, shares, share detail, requests, activities, user, types, genres, and regions.
  • Text filter plugin that parses all [ddys_*] shortcodes in formatted text.
  • Block plugin for placing any official DDYS shortcode in Drupal Block Layout, including detail views that need slug, ID, or username fields.
  • CKEditor 5 toolbar insertion helper for DDYS shortcodes.
  • Admin settings form and diagnostics form with API Key clear, connection test, cache clear, config checks, and canonical shortcode/page/proxy generator.
  • Local JSON proxy at /ddys-api/{route} with route and parameter allow-lists.
  • Server-side request form with Drupal Form API, CSRF token, validation, rate limiting, and authenticated API submission.
  • Drupal cache backend with TTL buckets and ddys_open cache tags.
  • Twig page template, frontend/admin libraries, and uninstall cleanup for DDYS config/cache state.
  • Display attributes for hiding poster, rating, or summary output when a compact embed is needed.
  • Escaped output, resource protocol allow-list, media URL validation, bounded numeric inputs, and no API Key exposure in frontend JavaScript.

Installation

  1. Build the package with tools/build-package.ps1.
  2. Extract or upload dist/ddys-drupal-module-v0.1.0.zip so the module lives at web/modules/custom/ddys_open.
  3. Enable DDYS API from Drupal Extend or run drush en ddys_open.
  4. Open Configuration -> Web services -> DDYS API.
  5. Configure API Base URL, Source Site URL, cache TTL, display settings, and optional API Key. Use Clear saved API Key if a saved key must be removed.
  6. Open the diagnostics tab to test the connection and generate shortcodes, page links, or proxy URLs.
  7. Enable the DDYS API shortcodes text filter on the desired text format.
  8. Place the DDYS API block from Block Layout when a sidebar or region widget is needed.

Shortcodes

[ddys_movies type="movie" per_page="24"]
[ddys_latest type="movie" limit="12"]
[ddys_hot limit="10"]
[ddys_search]
[ddys_suggest q="interstellar"]
[ddys_calendar year="2026" month="7"]
[ddys_movie slug="this-tempting-madness"]
[ddys_sources slug="this-tempting-madness"]
[ddys_related slug="this-tempting-madness"]
[ddys_comments slug="this-tempting-madness" per_page="20"]
[ddys_collections per_page="10"]
[ddys_collection slug="best-sci-fi"]
[ddys_shares per_page="10"]
[ddys_share id="1"]
[ddys_requests per_page="10"]
[ddys_activities per_page="10"]
[ddys_user username="demo"]
[ddys_types]
[ddys_genres]
[ddys_regions]
[ddys_request_form]

Frontend Pages

/ddys/latest
/ddys/hot
/ddys/movies
/ddys/search?q=interstellar
/ddys/suggest?q=interstellar
/ddys/calendar?year=2026&month=7
/ddys/movie/this-tempting-madness
/ddys/movie/this-tempting-madness/sources
/ddys/movie/this-tempting-madness/related
/ddys/movie/this-tempting-madness/comments
/ddys/collections
/ddys/collection/best-sci-fi
/ddys/shares
/ddys/share/1
/ddys/requests
/ddys/activities
/ddys/user/demo
/ddys/types
/ddys/genres
/ddys/regions

Local JSON Proxy

/ddys-api/latest?limit=12
/ddys-api/movie?slug=this-tempting-madness
/ddys-api/share?id=1

The module validates the route and query parameter allow-lists before requesting the DDYS API from the Drupal server.

Checks

node tools/check.mjs

The check covers Drupal module files, lifecycle hooks, services, routes, forms, block plugin, text filter, CKEditor 5 support, all 21 shortcodes, all 20 views, proxy/request/cache/security boundaries, icons, docs, package safety, and forbidden sensitive files.

About

低端影视 API 的官方 Drupal 模块,支持页面、区块、短代码、代理、缓存、诊断和求片表单。

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors