diff --git a/cloudflare-page-build/scripts/Build_Tools-IMGTest.js b/cloudflare-page-build/scripts/Build_Tools-IMGTest.js new file mode 100644 index 0000000..a0ff48c --- /dev/null +++ b/cloudflare-page-build/scripts/Build_Tools-IMGTest.js @@ -0,0 +1,23 @@ +const fs = require('fs'); +const path = require('path'); + +// 设置源文件和目标文件的路径 +const srcDir = path.join(__dirname, '..', '..', 'cloudflare-page'); // cloudflare-page 目录的路径 +const srcFilePath = path.join(srcDir, 'Tools-IMGTest.html'); // 源文件路径 +const destDir = path.join(__dirname, '..', '..', 'dist'); // 目标 dist 目录的路径 +const destToolsDir = path.join(destDir, 'tools'); // 目标 tools 目录的路径 +const destFilePath = path.join(destToolsDir, 'test.html'); // 目标文件路径 + +// 确保目标目录存在 +if (!fs.existsSync(destToolsDir)) { + fs.mkdirSync(destToolsDir, { recursive: true }); +} + +// 检查源文件是否存在 +if (fs.existsSync(srcFilePath)) { + // 复制并重命名文件 + fs.copyFileSync(srcFilePath, destFilePath); + console.log(`文件 ${srcFilePath} 已成功复制并重命名到 ${destFilePath}`); +} else { + console.log(`源文件 ${srcFilePath} 不存在。`); +} diff --git a/cloudflare-page/OneAPI-imgbed-MIX.html b/cloudflare-page/OneAPI-imgbed-MIX.html index d82437e..e89176c 100644 --- a/cloudflare-page/OneAPI-imgbed-MIX.html +++ b/cloudflare-page/OneAPI-imgbed-MIX.html @@ -72,14 +72,11 @@
diff --git a/cloudflare-page/Tools-IMGTest.html b/cloudflare-page/Tools-IMGTest.html new file mode 100644 index 0000000..a5f0fc4 --- /dev/null +++ b/cloudflare-page/Tools-IMGTest.html @@ -0,0 +1,219 @@ + + + + + 多接口图床可用性检测 + + + + +
+

多接口图床可用性检测

+

上传时间:2024年10月29日

+ + +
+

IPFS

+

图片URL:https://eth.sucks/ipfs/QmUFcsbncWVhja1xGGeHSxEk1MpGDhtSAaWhP8418vS7hz

+
+ 图片预览 +
+

检测中...

+
+ + + + + + + + +
+

AliEx

+

图片URL:https://ae01.alicdn.com/kf/A632c7925ee60472e9059db35e0c6dc50p.jpg

+
+ 图片预览 +
+

检测中...

+
+ + + + + +
+

TGPH

+

图片URL:https://telegra.ph/file/cba86a5f06c24dac99ecc-54641be50efaccd63d.jpg

+
+ 图片预览 +
+

检测中...

+
+ + +
+

vviptuangou

+

图片URL:https://assets.vviptuangou.com/c2ab03e2d62c6fddb35494935a6d9ae6eb0813e1.jpg

+
+ 图片预览 +
+

检测中...

+
+ + +
+

da8m

+

图片URL:https://assets.da8m.cn/c2ab03e2d62c6fddb35494935a6d9ae6eb0813e1.jpg

+
+ 图片预览 +
+

检测中...

+
+ +
+ + + + + diff --git a/cloudflare-worker-js-api/worker.js b/cloudflare-worker-js-api/worker.js index a721cfe..9343fbc 100644 --- a/cloudflare-worker-js-api/worker.js +++ b/cloudflare-worker-js-api/worker.js @@ -213,79 +213,7 @@ async function handleRequest(request) { } } - async function handleQst8Request(request) { - console.log('Request received:', request.url); - - if (request.method !== 'POST') { - return new Response('Method not allowed', { status: 405 }); - } - - try { - const formData = await request.formData(); - const file = formData.get('image'); // 使用 'image' 字段名 - if (!file) { - return new Response('No file uploaded', { status: 400 }); - } - - const newFormData = new FormData(); - newFormData.append('file', file, file.name); // 上传到目标服务器时使用 'file' - - const targetUrl = 'https://api.qst8.cn/api/front/upload/img'; - - const response = await fetch(targetUrl, { - method: 'POST', - body: newFormData, - headers: { - 'Accept': 'application/json, text/javascript, */*; q=0.01', - 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7', - 'Branchid': '1002', - 'Cache-Control': 'no-cache', - 'DNT': '1', - 'Origin': 'https://mlw10086.serv00.net', - 'Pragma': 'no-cache', - 'Priority': 'u=1, i', - 'Referer': 'https://mlw10086.serv00.net/', - 'Sec-Ch-Ua': '"Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"', - 'Sec-Ch-Ua-Mobile': '?0', - 'Sec-Ch-Ua-Platform': '"Windows"', - 'Sec-Fetch-Dest': 'empty', - 'Sec-Fetch-Mode': 'cors', - 'Sec-Fetch-Site': 'cross-site', - 'Sign': 'e346dedcb06bace9cd7ccc6688dd7ca1', // 替换为动态生成的sign值 - 'Source': 'h5', - 'Tenantid': '3', - 'Timestamp': '1725792862411', // 替换为动态生成的timestamp值 - 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' - } - }); - - console.log('Response status:', response.status); - const responseText = await response.text(); - console.log('Response body:', responseText); - - try { - const jsonResponse = JSON.parse(responseText); - if (jsonResponse.code === 200 && jsonResponse.data) { - // 返回 data 字段中的 URL - return new Response(jsonResponse.data, { - status: 200, - headers: { 'Content-Type': 'text/plain' } - }); - } - } catch (e) { - console.error('Failed to parse JSON:', e); - } - - return new Response(responseText, { - status: response.status, - headers: response.headers - }); - } catch (error) { - console.error('Error:', error); - return new Response('Internal Server Error', { status: 500 }); - } - } - + async function handleVviptuangouRequest(request) { console.log('Request received:', request.url); @@ -543,71 +471,6 @@ async function handleRequest(request) { } } - async function handle10086Request(request) { - console.log('Request received:', request.url); - - if (request.method !== 'POST') { - return new Response('Method not allowed', { status: 405 }); - } - - try { - const formData = await request.formData(); - const file = formData.get('image'); // 使用 'image' 字段名 - if (!file) { - return new Response('No file uploaded', { status: 400 }); - } - - const newFormData = new FormData(); - newFormData.append('file', file, file.name); // 上传到目标服务器时使用 'file' - - const targetUrl = 'https://mlw10086.serv00.net/upload.php'; - - const response = await fetch(targetUrl, { - method: 'POST', - body: newFormData, - headers: { - 'Accept': '*/*', - 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,zh-TW;q=0.7', - 'Cache-Control': 'no-cache', - 'DNT': '1', - 'Origin': 'https://mlw10086.serv00.net', - 'Pragma': 'no-cache', - 'Referer': 'https://mlw10086.serv00.net/', - 'Sec-Ch-Ua': '"Chromium";v="128", "Not;A=Brand";v="24", "Google Chrome";v="128"', - 'Sec-Ch-Ua-Mobile': '?0', - 'Sec-Ch-Ua-Platform': '"Windows"', - 'Sec-Fetch-Dest': 'empty', - 'Sec-Fetch-Mode': 'cors', - 'Sec-Fetch-Site': 'same-origin', - 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' - } - }); - - console.log('Response status:', response.status); - const responseText = await response.text(); - console.log('Response body:', responseText); - - try { - const jsonResponse = JSON.parse(responseText); - if (jsonResponse.code === 200 && jsonResponse.url) { - return new Response(jsonResponse.url, { - status: 200, - headers: { 'Content-Type': 'text/plain' } - }); - } - } catch (e) { - console.error('Failed to parse JSON:', e); - } - - return new Response(responseText, { - status: response.status, - headers: response.headers - }); - } catch (error) { - console.error('Error:', error); - return new Response('Internal Server Error', { status: 500 }); - } - } async function handleAliExpressRequest(request) { try { diff --git a/docs/History.md b/docs/History.md index 3887daf..752f930 100644 --- a/docs/History.md +++ b/docs/History.md @@ -16,3 +16,4 @@ - 20240908 新增 da8m,qts8,vviptuangou三个,均来自之前的10086,今天发现他改版了 - 20240912 新增 ipfs-img对接,来自 https://www.nodeseek.com/post-158028-1 ,TGPH临时修复方案,来自 https://www.nodeseek.com/post-159355-1 - 20241014 新增 AliEx对接,来自 https://jike.info/topic/36748/ ; 另外发现10086图床对CF IP进行了封禁 error "您的IP已被封禁,请联系管理员" ; 新增JDKF对接,来自即刻图床插件 +- 20241029 移除了几个不支持的,新增了一个图片Test页面 https://imgup.pages.dev/test diff --git a/package.json b/package.json index 9bf7528..ae2e9b0 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "build2": "node cloudflare-page-build/scripts/Build_Tools-TGPH.js", "build3": "node cloudflare-page-build/scripts/Build_Tools-IMGProxy.js", "build4": "node cloudflare-page-build/scripts/Build_Tools-GoogleCache.js", - "build": "npm run build1 && npm run build2 && npm run build3 && npm run build4" + "build5": "node cloudflare-page-build/scripts/Build_Tools-IMGTest.js", + "build": "npm run build1 && npm run build2 && npm run build3 && npm run build4 && npm run build5" }, "author": "BlueSkyXN", "license": "GPLv3", diff --git a/python-uploader/test-ali.py b/python-uploader/test-ali.py index 7637740..c002eea 100644 --- a/python-uploader/test-ali.py +++ b/python-uploader/test-ali.py @@ -3,7 +3,7 @@ import os import random # 上传图片的本地路径 -image_path = r"F:\Download\20241011-111233.jpg" +image_path = r"C:\Users\SKY\Pictures\20240125-144244.jpg" # AliExpress 上传接口的 URL upload_url = "https://filebroker.aliexpress.com/x/upload?jiketuchuang=1"