新增下载页面

This commit is contained in:
zyj
2025-10-21 18:30:40 +08:00
parent 2bb0c7dc98
commit 60f4995dc7
12 changed files with 953 additions and 204 deletions

View File

@@ -21,6 +21,13 @@ type RequestParams struct {
URL string `json:"url"`
}
type ResourcesList struct {
Script []string `json:"script"`
CSS []string `json:"css"`
Image []string `json:"image"`
Dom []string `json:"dom"`
}
// 获取当前页面的所有本站资源 js、css、img、链接
func (s SiteService) GetAllResources(rawURL string) ([]RequestParams, []string) {
var RequestParamsAll []RequestParams
@@ -43,14 +50,14 @@ func (s SiteService) GetAllResources(rawURL string) ([]RequestParams, []string)
s.BaseDomain = parsed.Hostname()
ActiveHref["https://"+host] = struct{}{}
// 进入主站
// browser := obj.Browser
browser := obj.Browser
page := obj.Page
s.LoopGet(page, PastHref, ActiveHref, &RequestParamsAll)
for k := range PastHref {
RouterAll = append(RouterAll, k)
}
list := deduplicationRequest(RequestParamsAll)
// 资源去重
browser.Close()
return list, RouterAll
}