Methods and Timing

This table applies to Java, Python and QuickJS; Node.js uses a separate HTTP endpoint.

Release your own sessions, WebSockets and background work in destroy. QuickJS waits at most 5 seconds (including promises) and then still disposes the engine.

MethodCalled whenResponsibilityMain return
initThe spider initializesRead ext, open connections or cachesnone
homeContent / homeEntering the home pageCategories and optional filtersResult.class
homeVideoContent / homeVodCategories have loadedRecommended cards on the home pageResult.list
categoryContent / categoryChanging category, page or filtersCards for that page and total pageslist + pagecount
detailContent / detailTapping a cardFull details and play groupslist[0]
searchContent / searchSearchingSearch results, optional paginglist + pagecount
playerContent / playSelecting an episodeFinal URL and playback parametersResult
danmakuWhen the site provides live danmakuDanmaku or subscription state objectsJava AutoCloseable锛廝ython, QuickJS stop function
liveContent / liveLoading live configurationTXT, M3U or Group JSONtext / Group array
proxy / localProxyThe local proxy receives a requestStatus, type, content and headers per runtimearray / HTTP response
actionCustom actionAnything parseable from ResultJava JSON string锛廝ython, QuickJS object
destroyReload or teardownRelease threads and connections; QuickJS cleanup hook up to 5 snone

Flow

init
Initialize
homeContent / home
Categories and filters
categoryContent / category
List and total pages
detailContent / detail
Details and episodes
playerContent / play
Final URL

searchContent and homeVideoContent are two other paths into details: search yields a list directly, while the App decides whether to show home recommendations.

Name mapping

JavaPythonQuickJS
homeContenthomeContenthome
homeVideoContenthomeVideoContenthomeVod
categoryContentcategoryContentcategory
detailContentdetailContentdetail
searchContentsearchContentsearch
playerContentplayerContentplay
liveContentliveContentlive
proxylocalProxyproxy
Tip

Close every session, WebSocket and background thread you created in destroy. Without it, reloading a spider accumulates connections.