公开页抓取改为 Chrome 136 自洽身份 + 每节点 SQLite 养罐,Trafilatura 走 curl_cffi;MCP/README/接手说明与 09-02 现网复测对齐,避免消费方继续抄过期的站点三分表。 Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
904 B
Go
33 lines
904 B
Go
package contract
|
||
|
||
// AdapterClass 会话罐分轨:HTTP 档与 CDP 档身份不同,禁止混罐。
|
||
const (
|
||
AdapterHTTP = "http"
|
||
AdapterCDP = "cdp"
|
||
)
|
||
|
||
// Cookie 目标站一等 Cookie(内部流转;禁止进 MCP 信封)。
|
||
type Cookie struct {
|
||
Name string `json:"name"`
|
||
Value string `json:"value"`
|
||
Domain string `json:"domain,omitempty"`
|
||
Path string `json:"path,omitempty"`
|
||
Expires int64 `json:"expires,omitempty"` // unix 秒;0=用默认 TTL
|
||
}
|
||
|
||
// SessionAttach 调度器在 Execute 前注入,json:"-" 不进 jobs.payload。
|
||
type SessionAttach struct {
|
||
TemplateID string
|
||
Impersonate string
|
||
UserAgent string
|
||
Headers map[string]string
|
||
Cookies []Cookie
|
||
AdapterClass string
|
||
Egress string
|
||
ETLD string
|
||
}
|
||
|
||
// WithSession 给任务挂会话(不改已落库 payload)。
|
||
func (j *JobEnvelope) WithSession(s *SessionAttach) {
|
||
j.Session = s
|
||
}
|