Loading a Spider
Before writing a spider, make sure the App can find it. The api field in Site configuration decides how it runs.
Minimal Site configuration
type is always 3; key must be unique and name is the display name.
Java JAR
Configuration value: api: "csp_Demo"
Put the class at com.github.catvod.spider.Demo and extend the abstract Spider; the root configuration must provide spider or the site's jar. Compile against catvod-api.jar as a compileOnly dependency; the TV root task :apiJar generates it at build/outputs/api/catvod-api.jar.
Python
Configuration value: api: "./demo.py"
Relative paths resolve from the configuration file location; export a Spider class extending base.spider.Spider.
QuickJS
Configuration value: api: "./demo.js"
JavaScript runs on QuickJS; relative paths resolve from the configuration file location. Use an ES module that default-exports an object or a function returning one.
Relative paths also work for ext and jar. See the configuration reference 路 Site for every field.
Next
- Install runtime modules before the first run.
- Confirm responses with testing a spider.
- Jump straight to the three-language demo.