Site

Four types

typeMeaning
0XML over HTTP
1JSON over HTTP
3JAR / PY / JS
4HTTP extension

Fields

FieldTypeRequiredDefaultNotes
keystringyes—Unique site identifier, never duplicated.
namestringyes—Display name.
typeintegerno00=XML HTTP, 1=JSON HTTP, 3=Spider; 4=extended HTTP JSON, where category filters travel as Base64 ext and the site ext as extend.
apistringyes—HTTP endpoint, csp_ class, or a .//../ relative .js/.py path; absolute URLs also work.
extstring | object | arrayno—For type 3 passed to Spider.init; HTTP sites receive it as extend. Objects and arrays are serialized first; the root configuration may use a URL or relative path.
jarstringno—JAR location overriding the global spider.
clickstringno—JavaScript click handler run in the WebView.
playUrlstringno—Parse URL prefix for type 0/1; supports json: endpoints or parse: parser names. For type 3/4 it comes from the playback Result.playUrl.
hideintegerno01 hides the site from the site list.
indexsintegerno01 marks the site as an index site.
timeoutintegerno15Playback timeout in seconds, minimum 1.
searchableintegerno10=permanently disabled, 1=enabled; may also be saved as 2 at runtime.
changeableintegerno10=locked, 1=switchable; may also be saved as 2 at runtime.
langstringno—Search keyword conversion language, supports Traditional/Simplified Chinese tags; other non-empty values keep the original text, an empty value uses the existing conversion.
danmakuintegerno10 disables automatic search through the global danmaku API for this site; the spider's own danmaku is unaffected.
quickSearchintegerno10 skips quick search, 1 enables it.
categoriesstring[]no—When names match, keep only matching categories in list order; when nothing matches, keep all.
headerobjectno—HTTP API request headers; also the default when the playback Result.header is empty. Type 3 requests made by the spider do not inherit it.
styleStyleno—Default card style for the site.

Type 3 site sample

sites[] object fragment

{
  "key": "js_demo",
  "name": "QuickJS Demo",
  "type": 3,
  "api": "./demo.js",
  "ext": { "region": "tw" },
  "searchable": 1,
  "changeable": 1,
  "categories": ["Movies", "Series"],
  "header": { "User-Agent": "ExampleClient/1.0" },
  "style": { "type": "rect", "ratio": 1.33 }
}

To switch to Python just change api to ./demo.py; for a Java class use csp_Demo. Relative paths also work for ext and jar.

Python, QuickJS and Node.js need the modules installed first; confirm responses on the spider test page.

Tip

header only affects HTTP requests issued by the App. Requests a type 3 spider makes itself must set headers in code or through net options.