|
|
|
@ -614,7 +614,7 @@ func downloadImage(url, dir, filename string) error { |
|
|
|
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36") |
|
|
|
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36") |
|
|
|
req.Header.Set("Accept", "image/webp,image/apng,image/*,*/*;q=0.8") |
|
|
|
req.Header.Set("Accept", "image/webp,image/apng,image/*,*/*;q=0.8") |
|
|
|
req.Header.Set("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8") |
|
|
|
req.Header.Set("Accept-Language", "zh-CN,zh;q=0.9,en;q=0.8") |
|
|
|
req.Header.Set("Referer", "https://hd4k.com/") |
|
|
|
// req.Header.Set("Referer", "https://hd4k.com/")
|
|
|
|
|
|
|
|
|
|
|
|
resp, err := client.Do(req) |
|
|
|
resp, err := client.Do(req) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
@ -662,7 +662,7 @@ func main() { |
|
|
|
http.HandleFunc("/api/download_missing", enableCORS(downloadMissingHandler)) |
|
|
|
http.HandleFunc("/api/download_missing", enableCORS(downloadMissingHandler)) |
|
|
|
http.HandleFunc("/api/cleanup_json", enableCORS(cleanupJsonHandler)) |
|
|
|
http.HandleFunc("/api/cleanup_json", enableCORS(cleanupJsonHandler)) |
|
|
|
|
|
|
|
|
|
|
|
fmt.Printf("HD4K下载服务启动\n") |
|
|
|
fmt.Printf("Images下载服务启动\n") |
|
|
|
fmt.Printf("下载目录: %s\n", *downloadDir) |
|
|
|
fmt.Printf("下载目录: %s\n", *downloadDir) |
|
|
|
fmt.Printf("保存JSON API: http://127.0.0.1:%s/api/save_json\n", *port) |
|
|
|
fmt.Printf("保存JSON API: http://127.0.0.1:%s/api/save_json\n", *port) |
|
|
|
fmt.Printf("管理页面: http://127.0.0.1:%s/\n", *port) |
|
|
|
fmt.Printf("管理页面: http://127.0.0.1:%s/\n", *port) |
|
|
|
|