++
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# HD4K下载器 - 跨平台构建脚本
|
# Images下载器 - 跨平台构建脚本
|
||||||
echo "HD4K下载器 - 跨平台构建"
|
echo "Images下载器 - 跨平台构建"
|
||||||
|
|
||||||
# 设置变量
|
# 设置变量
|
||||||
BUILD_DIR="./build"
|
BUILD_DIR="./build"
|
||||||
@@ -32,7 +32,7 @@ fi
|
|||||||
|
|
||||||
# 构建Windows版本
|
# 构建Windows版本
|
||||||
echo "构建Windows版本..."
|
echo "构建Windows版本..."
|
||||||
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o "${BUILD_DIR}/hd4k-downloader-windows.exe" main.go
|
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o "${BUILD_DIR}/images-downloader-windows.exe" main.go
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "✅ Windows版本构建成功"
|
echo "✅ Windows版本构建成功"
|
||||||
else
|
else
|
||||||
@@ -41,20 +41,20 @@ fi
|
|||||||
|
|
||||||
# 构建macOS Intel版本
|
# 构建macOS Intel版本
|
||||||
echo "构建macOS Intel版本..."
|
echo "构建macOS Intel版本..."
|
||||||
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o "${BUILD_DIR}/hd4k-downloader-macos-intel" main.go
|
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o "${BUILD_DIR}/images-downloader-macos-intel" main.go
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "✅ macOS Intel版本构建成功"
|
echo "✅ macOS Intel版本构建成功"
|
||||||
chmod +x "${BUILD_DIR}/hd4k-downloader-macos-intel"
|
chmod +x "${BUILD_DIR}/images-downloader-macos-intel"
|
||||||
else
|
else
|
||||||
echo "❌ macOS Intel版本构建失败"
|
echo "❌ macOS Intel版本构建失败"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 构建macOS ARM版本
|
# 构建macOS ARM版本
|
||||||
echo "构建macOS ARM版本..."
|
echo "构建macOS ARM版本..."
|
||||||
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o "${BUILD_DIR}/hd4k-downloader-macos-arm" main.go
|
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o "${BUILD_DIR}/images-downloader-macos-arm" main.go
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "✅ macOS ARM版本构建成功"
|
echo "✅ macOS ARM版本构建成功"
|
||||||
chmod +x "${BUILD_DIR}/hd4k-downloader-macos-arm"
|
chmod +x "${BUILD_DIR}/images-downloader-macos-arm"
|
||||||
else
|
else
|
||||||
echo "❌ macOS ARM版本构建失败"
|
echo "❌ macOS ARM版本构建失败"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
module hd4k-downloader
|
module images-downloader
|
||||||
|
|
||||||
go 1.25.1
|
go 1.25.1
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
+2
-2
@@ -3,14 +3,14 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>HD4K 下载管理</title>
|
<title>Images 下载管理</title>
|
||||||
<link rel="stylesheet" href="index.css">
|
<link rel="stylesheet" href="index.css">
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<header>
|
<header>
|
||||||
<h1><i class="fas fa-download"></i> HD4K 下载管理</h1>
|
<h1><i class="fas fa-download"></i> Images 下载管理</h1>
|
||||||
<p class="subtitle">管理未完成的下载任务</p>
|
<p class="subtitle">管理未完成的下载任务</p>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user