mirror of
https://github.com/oneclickvirt/ecs.git
synced 2025-10-04 23:12:49 +08:00
update
This commit is contained in:
29
goecs.go
29
goecs.go
@@ -13,6 +13,9 @@ import (
|
|||||||
"github.com/oneclickvirt/ecs/unlocktest"
|
"github.com/oneclickvirt/ecs/unlocktest"
|
||||||
"github.com/oneclickvirt/ecs/utils"
|
"github.com/oneclickvirt/ecs/utils"
|
||||||
"github.com/oneclickvirt/portchecker/email"
|
"github.com/oneclickvirt/portchecker/email"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"regexp"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@@ -151,7 +154,31 @@ func main() {
|
|||||||
fmt.Println("Unsupported language")
|
fmt.Println("Unsupported language")
|
||||||
}
|
}
|
||||||
}, tempOutput, output)
|
}, tempOutput, output)
|
||||||
shorturl, err := utils.UploadText(output)
|
// 创建文件
|
||||||
|
filePath := "goecs.txt"
|
||||||
|
file, err := os.Create(filePath)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Can not make file:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer file.Close()
|
||||||
|
// 将 output 写入文件
|
||||||
|
// 匹配 ANSI 转义序列
|
||||||
|
ansiRegex := regexp.MustCompile("\x1B\\[[0-9;]+[a-zA-Z]")
|
||||||
|
// 移除 ANSI 转义序列
|
||||||
|
cleanedOutput := ansiRegex.ReplaceAllString(output, "")
|
||||||
|
_, err = file.WriteString(cleanedOutput)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Can not write file:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 获取文件的绝对路径
|
||||||
|
absPath, err := filepath.Abs(filePath)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Get file absPath failed:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
shorturl, err := utils.UploadText(absPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Upload failed, can not generate short URL.")
|
fmt.Println("Upload failed, can not generate short URL.")
|
||||||
fmt.Println(err.Error())
|
fmt.Println(err.Error())
|
||||||
|
108
goecs.txt
Normal file
108
goecs.txt
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
---------------------------------------融合怪测试----------------------------------------
|
||||||
|
版本:2024.06.30
|
||||||
|
测评频道: https://t.me/vps_reviews
|
||||||
|
Go项目地址:https://github.com/oneclickvirt/ecs
|
||||||
|
Shell项目地址:https://github.com/spiritLHLS/ecs
|
||||||
|
----------------------------------------基础信息----------------------------------------
|
||||||
|
CPU 型号 : AMD Ryzen 7 4700U with Radeon Graphics
|
||||||
|
CPU 数量 : 8 Physical CPU(s)
|
||||||
|
CPU 缓存 : L1: null / L2: 4.00 MB / L3: 8.00 MB
|
||||||
|
VM-x/AMD-V/Hyper-V : ❌ Disabled
|
||||||
|
内存 : 10.90 GB / 15.37 GB
|
||||||
|
Swap : 16.23 GB / 22.12 GB
|
||||||
|
硬盘空间 : 213.82 GB / 475.67 GB
|
||||||
|
启动盘路径 : C:
|
||||||
|
系统 : Microsoft Windows 11 Enterprise 10.0.22631 Build 22631 [x86_64]
|
||||||
|
系统在线时间 : 5 days, 02 hours, 41 minutes
|
||||||
|
时区 : (UTC+08:00) 北京,重庆,香港特别行政区,乌鲁木齐
|
||||||
|
负载 : 0.50 / 0.00 / 0.00
|
||||||
|
虚拟化架构 : Physical-Machine(Multiprocessor Free)
|
||||||
|
NAT类型 : Symmetric
|
||||||
|
IPV4 ASN : AS4538 China Education and Research Network Center
|
||||||
|
IPV4 Location : Guangzhou / Guangdong / China
|
||||||
|
IPV6 ASN : AS24357 CERNET2 IX at South China University of Technology
|
||||||
|
IPV6 Location : Guangzhou / Guangdong / China
|
||||||
|
---------------------------------CPU测试-通过sysbench测试---------------------------------
|
||||||
|
Detected host is Windows, using Winsat for testing.
|
||||||
|
CPU AES256 加密: 7421.91MB/s
|
||||||
|
CPU LZW 压缩: 664.76MB/s
|
||||||
|
---------------------------------内存测试-通过sysbench测试----------------------------------
|
||||||
|
Detected host is Windows, using Winsat for testing.
|
||||||
|
内存性能: 31643.60MB/s
|
||||||
|
------------------------------------硬盘测试-通过fio测试------------------------------------
|
||||||
|
测试的硬盘 随机写入[得分] 顺序读取[得分] 顺序写入[得分]
|
||||||
|
C: 202.43 MB/s[7.8] 2212.48 MB/s[9.1] 1709.12 MB/s[8.9]
|
||||||
|
--------------------------------------御三家流媒体解锁--------------------------------------
|
||||||
|
[37m[01m----------------Netflix-----------------
|
||||||
|
[0m[32m[01m[IPV4][0m
|
||||||
|
[33m[01mNetflix在您的出口IP所在的国家不提供服务[0m
|
||||||
|
[32m[01m[IPV6][0m
|
||||||
|
[33m[01m您的网络可能没有正常配置IPv6,或者没有IPv6网络接入[0m
|
||||||
|
[37m[01m----------------Youtube-----------------
|
||||||
|
[0m[32m[01m[IPV4][0m
|
||||||
|
[33m[01mYoutube在您的出口IP所在的国家不提供服务[0m
|
||||||
|
[32m[01m[IPV6][0m
|
||||||
|
[33m[01mYoutube在您的出口IP所在的国家不提供服务[0m
|
||||||
|
[37m[01m---------------DisneyPlus---------------
|
||||||
|
[0m[32m[01m[IPV4][0m
|
||||||
|
[36m[01m当前IPv4出口所在地区即将开通DisneyPlus[0m
|
||||||
|
[32m[01m[IPV6][0m
|
||||||
|
[33m[01mDisneyPlus在您的出口IP所在的国家不提供服务[0m
|
||||||
|
--------------------------------------跨国流媒体解锁---------------------------------------
|
||||||
|
[36m[01mIPV4:[0m
|
||||||
|
============[ 跨国平台 ]============
|
||||||
|
Dazn [31m[01mNO[0m[31m[01m (UNSUPPORTED_COUNTRY)[0m
|
||||||
|
Disney+ [31m[01mNO[0m[31m[01m (Can not get assertion)[0m
|
||||||
|
Netflix [31m[01mBanned[0m
|
||||||
|
Netflix CDN [31m[01mNO[0m[31m[01m (IP Banned By Netflix)[0m
|
||||||
|
YouTube Region [31m[01mNO[0m[33m[01m (Network Err)[0m
|
||||||
|
YouTube CDN [31m[01mNO[0m[33m[01m (Network Err)[0m
|
||||||
|
Amazon Prime Video [31m[01mNO[0m[31m[01m (Region: CN)[0m
|
||||||
|
Paramount+ [32m[01mYES[0m[32m[01m [Via DNS][0m
|
||||||
|
TVBAnywhere+ [31m[01mNO[0m
|
||||||
|
IQiYi [32m[01mYES[0m[32m[01m (Region: CN)[0m[32m[01m [Via DNS][0m
|
||||||
|
Viu.com [32m[01mYES[0m[32m[01m [Via DNS][0m
|
||||||
|
Spotify Registration [31m[01mNO[0m
|
||||||
|
Steam Store [32m[01mYES[0m[32m[01m (Community Unavailable)[0m[32m[01m (Region: CN)[0m
|
||||||
|
ChatGPT [31m[01mNO[0m
|
||||||
|
Wikipedia Editability [31m[01mNO[0m[33m[01m (Network Err)[0m
|
||||||
|
TikTok [31m[01mNO[0m[33m[01m (Network Err)[0m
|
||||||
|
Bing Region [32m[01mYES[0m[32m[01m (Only cn.bing.com)[0m[32m[01m (Region: CN)[0m
|
||||||
|
Instagram Licensed Audio [31m[01mNO[0m[33m[01m (Network Err)[0m
|
||||||
|
KOCOWA [31m[01mNO[0m
|
||||||
|
SonyLiv [31m[01mNO[0m
|
||||||
|
OneTrust [32m[01mYES[0m[32m[01m (Region: CN GUANGDONG)[0m[32m[01m [Via DNS][0m
|
||||||
|
GoogleSearch [31m[01mNO[0m[33m[01m (Network Err)[0m
|
||||||
|
---------------------------------------IP质量检测---------------------------------------
|
||||||
|
---------------------------------------邮件端口检测---------------------------------------
|
||||||
|
Platform SMTP SMTPS POP3 POP3S IMAP IMAPS
|
||||||
|
LocalPort ✔ ✔ ✔ ✔ ✔ ✔
|
||||||
|
QQ ✔ ✔ ✔ ✘ ✔ ✘
|
||||||
|
163 ✔ ✔ ✔ ✘ ✔ ✘
|
||||||
|
Sohu ✔ ✔ ✘ ✘ ✔ ✘
|
||||||
|
Yandex ✔ ✔ ✔ ✘ ✔ ✘
|
||||||
|
Gmail ✘ ✘ ✘ ✘ ✘ ✘
|
||||||
|
Outlook ✔ ✘ ✔ ✘ ✔ ✘
|
||||||
|
Office365 ✔ ✘ ✔ ✘ ✔ ✘
|
||||||
|
Yahoo ✔ ✔ ✘ ✘ ✘ ✘
|
||||||
|
MailCOM ✔ ✔ ✔ ✘ ✔ ✘
|
||||||
|
MailRU ✔ ✔ ✘ ✘ ✔ ✘
|
||||||
|
AOL ✔ ✔ ✘ ✘ ✘ ✘
|
||||||
|
GMX ✔ ✘ ✔ ✘ ✔ ✘
|
||||||
|
Sina ✔ ✘ ✔ ✘ ✔ ✘
|
||||||
|
---------------------------------------就近节点测速---------------------------------------
|
||||||
|
位置 上传速度 下载速度 延迟 丢包率
|
||||||
|
Speedtest.net 4.32 Mbps 3.54 Mbps 12.205264ms 0.00% (Sent: 402/Dup: 0/Max: 401)
|
||||||
|
新加坡 18.50 Mbps 23.82 Mbps 51.944512ms N/A
|
||||||
|
洛杉矶 19.51 Mbps 8.51 Mbps 184.661804ms N/A
|
||||||
|
日本东京 1.47 Mbps 24.63 Mbps 201.89396ms N/A
|
||||||
|
法兰克福 19.22 Mbps 23.59 Mbps 245.545712ms N/A
|
||||||
|
联通Wu Xi -0.00 Mbps -0.00 Mbps 1s N/A
|
||||||
|
电信合肥5G 19.00 Mbps 24.51 Mbps 24.894272ms N/A
|
||||||
|
电信浙江 18.60 Mbps 23.93 Mbps 25.354408ms N/A
|
||||||
|
移动杭州5G 0.08 Mbps 23.74 Mbps 29.578304ms N/A
|
||||||
|
移动Beijing 18.70 Mbps 23.71 Mbps 40.95098ms N/A
|
||||||
|
------------------------------------------------------------------------------------
|
||||||
|
花费 : 7 分 53 秒
|
||||||
|
时间 : Sun Jun 30 20:47:15 CST 2024
|
||||||
|
------------------------------------------------------------------------------------
|
@@ -3,6 +3,7 @@ package speedtest
|
|||||||
import (
|
import (
|
||||||
"github.com/oneclickvirt/speedtest/model"
|
"github.com/oneclickvirt/speedtest/model"
|
||||||
"github.com/oneclickvirt/speedtest/sp"
|
"github.com/oneclickvirt/speedtest/sp"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -11,7 +12,11 @@ func ShowHead(language string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NearbySP() {
|
func NearbySP() {
|
||||||
|
if runtime.GOOS == "windows" || sp.OfficialAvailableTest() != nil {
|
||||||
sp.NearbySpeedTest()
|
sp.NearbySpeedTest()
|
||||||
|
} else {
|
||||||
|
sp.OfficialNearbySpeedTest()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func CustomSP(platform, operator string, num int) {
|
func CustomSP(platform, operator string, num int) {
|
||||||
@@ -53,5 +58,9 @@ func CustomSP(platform, operator string, num int) {
|
|||||||
}
|
}
|
||||||
parseType = "id"
|
parseType = "id"
|
||||||
}
|
}
|
||||||
|
if runtime.GOOS == "windows" || sp.OfficialAvailableTest() != nil {
|
||||||
sp.CustomSpeedTest(url, parseType, num)
|
sp.CustomSpeedTest(url, parseType, num)
|
||||||
|
} else {
|
||||||
|
sp.OfficialCustomSpeedTest(url, parseType, num)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -151,10 +151,11 @@ func PrintAndCapture(f func(), tempOutput, output string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UploadText 上传文本内容到指定URL
|
// UploadText 上传文本内容到指定URL
|
||||||
func UploadText(textContent string) (string, error) {
|
func UploadText(absPath string) (string, error) {
|
||||||
url := "https://paste.spiritlhl.net/api/upload"
|
url := "https://paste.spiritlhl.net/api/upload"
|
||||||
token := network.SecurityUploadToken
|
token := network.SecurityUploadToken
|
||||||
client := req.C().SetTimeout(10 * 1000 * 1000) // 10 seconds timeout
|
client := req.DefaultClient()
|
||||||
|
file, _ := os.Open(absPath)
|
||||||
resp, err := client.R().
|
resp, err := client.R().
|
||||||
SetHeader("Authorization", token).
|
SetHeader("Authorization", token).
|
||||||
SetHeader("Format", "RANDOM").
|
SetHeader("Format", "RANDOM").
|
||||||
@@ -162,7 +163,7 @@ func UploadText(textContent string) (string, error) {
|
|||||||
SetHeader("UploadText", "true").
|
SetHeader("UploadText", "true").
|
||||||
SetHeader("Content-Type", "multipart/form-data").
|
SetHeader("Content-Type", "multipart/form-data").
|
||||||
SetHeader("No-JSON", "true").
|
SetHeader("No-JSON", "true").
|
||||||
SetBodyString(textContent).
|
SetFileReader("file", "goecs.txt", file).
|
||||||
Post(url)
|
Post(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
Reference in New Issue
Block a user