diff --git a/linux/src/cf.sh b/linux/src/cf.sh index ba138d7..4c96b49 100644 --- a/linux/src/cf.sh +++ b/linux/src/cf.sh @@ -1,5 +1,5 @@ #!/bin/bash -# random cloudflare anycast ip +# better-cloudflare-ip declare -i bandwidth declare -i speed read -p "请设置期望到 CloudFlare 服务器的带宽大小(单位 Mbps):" bandwidth @@ -20,12 +20,12 @@ do do if [ ! -f "meta.txt" ] then - curl --ipv4 --resolve speed.cloudflare.com:443:$resolveip --retry 3 -v https://speed.cloudflare.com/__down>meta.txt 2>&1 + curl --ipv4 --resolve speed.cloudflare.com:443:$resolveip --retry 3 -s https://speed.cloudflare.com/meta | sed -e 's/{//g' -e 's/}//g' -e 's/"//g' -e 's/,/\n/g'>meta.txt else - asn=$(cat meta.txt | grep cf-meta-asn: | tr '\r' '\n' | awk '{print $3}') - city=$(cat meta.txt | grep cf-meta-city: | tr '\r' '\n' | awk '{print $3}') - latitude=$(cat meta.txt | grep cf-meta-latitude: | tr '\r' '\n' | awk '{print $3}') - longitude=$(cat meta.txt | grep cf-meta-longitude: | tr '\r' '\n' | awk '{print $3}') + asn=$(cat meta.txt | grep asn: | awk -F: '{print $2}') + city=$(cat meta.txt | grep city: | awk -F: '{print $2}') + latitude=$(cat meta.txt | grep latitude: | awk -F: '{print $2}') + longitude=$(cat meta.txt | grep longitude: | awk -F: '{print $2}') curl --ipv4 --resolve service.udpfile.com:443:$resolveip --retry 3 "https://service.udpfile.com?asn="$asn"&city="$city"" -o data.txt -# break fi @@ -36,12 +36,12 @@ do do if [ ! -f "meta.txt" ] then - curl --ipv4 --retry 3 -v https://speed.cloudflare.com/__down>meta.txt 2>&1 + curl --ipv4 --retry 3 -s https://speed.cloudflare.com/meta | sed -e 's/{//g' -e 's/}//g' -e 's/"//g' -e 's/,/\n/g'>meta.txt else - asn=$(cat meta.txt | grep cf-meta-asn: | tr '\r' '\n' | awk '{print $3}') - city=$(cat meta.txt | grep cf-meta-city: | tr '\r' '\n' | awk '{print $3}') - latitude=$(cat meta.txt | grep cf-meta-latitude: | tr '\r' '\n' | awk '{print $3}') - longitude=$(cat meta.txt | grep cf-meta-longitude: | tr '\r' '\n' | awk '{print $3}') + asn=$(cat meta.txt | grep asn: | awk -F: '{print $2}') + city=$(cat meta.txt | grep city: | awk -F: '{print $2}') + latitude=$(cat meta.txt | grep latitude: | awk -F: '{print $2}') + longitude=$(cat meta.txt | grep longitude: | awk -F: '{print $2}') curl --ipv4 --retry 3 "https://service.udpfile.com?asn="$asn"&city="$city"" -o data.txt -# break fi @@ -56,7 +56,7 @@ do file=$(cat data.txt | grep file= | cut -f 2- -d'=') url=$(cat data.txt | grep url= | cut -f 2- -d'=') app=$(cat data.txt | grep app= | cut -f 2- -d'=') - if [ "$app" != "20210825" ] + if [ "$app" != "20210903" ] then echo 发现新版本程序: $app echo 更新地址: $url @@ -163,9 +163,9 @@ do echo 峰值速度 $max kB/s if [ $max1 -ge $max2 ] then - curl --ipv4 --resolve service.udpfile.com:443:$first --retry 3 -s -X POST -d ''20210825-$first-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$first --retry 3 -s -X POST -d ''20210903-$first-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 else - curl --ipv4 --resolve service.udpfile.com:443:$first --retry 3 -s -X POST -d ''20210825-$first-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$first --retry 3 -s -X POST -d ''20210903-$first-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 fi echo 第一次测试 $second curl --resolve $domain:443:$second https://$domain/$file -o /dev/null --connect-timeout 5 --max-time 10 > log.txt 2>&1 @@ -239,9 +239,9 @@ do echo 峰值速度 $max kB/s if [ $max1 -ge $max2 ] then - curl --ipv4 --resolve service.udpfile.com:443:$second --retry 3 -s -X POST -d ''20210825-$second-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$second --retry 3 -s -X POST -d ''20210903-$second-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 else - curl --ipv4 --resolve service.udpfile.com:443:$second --retry 3 -s -X POST -d ''20210825-$second-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$second --retry 3 -s -X POST -d ''20210903-$second-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 fi echo 第一次测试 $third curl --resolve $domain:443:$third https://$domain/$file -o /dev/null --connect-timeout 5 --max-time 10 > log.txt 2>&1 @@ -315,9 +315,9 @@ do echo 峰值速度 $max kB/s if [ $max1 -ge $max2 ] then - curl --ipv4 --resolve service.udpfile.com:443:$third --retry 3 -s -X POST -d ''20210825-$third-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$third --retry 3 -s -X POST -d ''20210903-$third-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 else - curl --ipv4 --resolve service.udpfile.com:443:$third --retry 3 -s -X POST -d ''20210825-$third-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$third --retry 3 -s -X POST -d ''20210903-$third-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 fi fi done @@ -330,7 +330,7 @@ done start_seconds=$(date --date="$starttime" +%s) end_seconds=$(date --date="$endtime" +%s) clear - curl --ipv4 --resolve service.udpfile.com:443:$anycast --retry 3 -s -X POST -d ''20210825-$anycast-$max'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o temp.txt + curl --ipv4 --resolve service.udpfile.com:443:$anycast --retry 3 -s -X POST -d ''20210903-$anycast-$max'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o temp.txt publicip=$(cat temp.txt | grep publicip= | cut -f 2- -d'=') colo=$(cat temp.txt | grep colo= | cut -f 2- -d'=') rm -rf temp.txt diff --git a/shell/cf-openwrt.sh b/shell/cf-openwrt.sh index 06774b3..ae8aa93 100644 --- a/shell/cf-openwrt.sh +++ b/shell/cf-openwrt.sh @@ -1,5 +1,5 @@ #!/bin/bash -# random cloudflare anycast ip +# better-cloudflare-ip declare -i bandwidth declare -i speed read -p "请设置期望到 CloudFlare 服务器的带宽大小(单位 Mbps):" bandwidth @@ -24,12 +24,12 @@ do do if [ ! -f "meta.txt" ] then - curl --ipv4 --resolve speed.cloudflare.com:443:$resolveip --retry 3 -v https://speed.cloudflare.com/__down>meta.txt 2>&1 + curl --ipv4 --resolve speed.cloudflare.com:443:$resolveip --retry 3 -s https://speed.cloudflare.com/meta | sed -e 's/{//g' -e 's/}//g' -e 's/"//g' -e 's/,/\n/g'>meta.txt else - asn=$(cat meta.txt | grep cf-meta-asn: | tr '\r' '\n' | awk '{print $3}') - city=$(cat meta.txt | grep cf-meta-city: | tr '\r' '\n' | awk '{print $3}') - latitude=$(cat meta.txt | grep cf-meta-latitude: | tr '\r' '\n' | awk '{print $3}') - longitude=$(cat meta.txt | grep cf-meta-longitude: | tr '\r' '\n' | awk '{print $3}') + asn=$(cat meta.txt | grep asn: | awk -F: '{print $2}') + city=$(cat meta.txt | grep city: | awk -F: '{print $2}') + latitude=$(cat meta.txt | grep latitude: | awk -F: '{print $2}') + longitude=$(cat meta.txt | grep longitude: | awk -F: '{print $2}') curl --ipv4 --resolve service.udpfile.com:443:$resolveip --retry 3 "https://service.udpfile.com?asn="$asn"&city="$city"" -o data.txt -# break fi @@ -40,12 +40,12 @@ do do if [ ! -f "meta.txt" ] then - curl --ipv4 --retry 3 -v https://speed.cloudflare.com/__down>meta.txt 2>&1 + curl --ipv4 --retry 3 -s https://speed.cloudflare.com/meta | sed -e 's/{//g' -e 's/}//g' -e 's/"//g' -e 's/,/\n/g'>meta.txt else - asn=$(cat meta.txt | grep cf-meta-asn: | tr '\r' '\n' | awk '{print $3}') - city=$(cat meta.txt | grep cf-meta-city: | tr '\r' '\n' | awk '{print $3}') - latitude=$(cat meta.txt | grep cf-meta-latitude: | tr '\r' '\n' | awk '{print $3}') - longitude=$(cat meta.txt | grep cf-meta-longitude: | tr '\r' '\n' | awk '{print $3}') + asn=$(cat meta.txt | grep asn: | awk -F: '{print $2}') + city=$(cat meta.txt | grep city: | awk -F: '{print $2}') + latitude=$(cat meta.txt | grep latitude: | awk -F: '{print $2}') + longitude=$(cat meta.txt | grep longitude: | awk -F: '{print $2}') curl --ipv4 --retry 3 "https://service.udpfile.com?asn="$asn"&city="$city"" -o data.txt -# break fi @@ -60,7 +60,7 @@ do file=$(cat data.txt | grep file= | cut -f 2- -d'=') url=$(cat data.txt | grep url= | cut -f 2- -d'=') app=$(cat data.txt | grep app= | cut -f 2- -d'=') - if [ "$app" != "20210825" ] + if [ "$app" != "20210903" ] then echo 发现新版本程序: $app echo 更新地址: $url @@ -198,9 +198,9 @@ do echo 峰值速度 $max kB/s if [ $max1 -ge $max2 ] then - curl --ipv4 --resolve service.udpfile.com:443:$first --retry 3 -s -X POST -d ''20210825-$first-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$first --retry 3 -s -X POST -d ''20210903-$first-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 else - curl --ipv4 --resolve service.udpfile.com:443:$first --retry 3 -s -X POST -d ''20210825-$first-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$first --retry 3 -s -X POST -d ''20210903-$first-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 fi echo 第一次测试 $second curl --resolve $domain:443:$second https://$domain/$file -o /dev/null --connect-timeout 5 --max-time 10 > log.txt 2>&1 @@ -274,9 +274,9 @@ do echo 峰值速度 $max kB/s if [ $max1 -ge $max2 ] then - curl --ipv4 --resolve service.udpfile.com:443:$second --retry 3 -s -X POST -d ''20210825-$second-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$second --retry 3 -s -X POST -d ''20210903-$second-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 else - curl --ipv4 --resolve service.udpfile.com:443:$second --retry 3 -s -X POST -d ''20210825-$second-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$second --retry 3 -s -X POST -d ''20210903-$second-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 fi echo 第一次测试 $third curl --resolve $domain:443:$third https://$domain/$file -o /dev/null --connect-timeout 5 --max-time 10 > log.txt 2>&1 @@ -350,9 +350,9 @@ do echo 峰值速度 $max kB/s if [ $max1 -ge $max2 ] then - curl --ipv4 --resolve service.udpfile.com:443:$third --retry 3 -s -X POST -d ''20210825-$third-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$third --retry 3 -s -X POST -d ''20210903-$third-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 else - curl --ipv4 --resolve service.udpfile.com:443:$third --retry 3 -s -X POST -d ''20210825-$third-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$third --retry 3 -s -X POST -d ''20210903-$third-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 fi fi done @@ -365,7 +365,7 @@ done start_seconds=$(date --date="$starttime" +%s) end_seconds=$(date --date="$endtime" +%s) clear - curl --ipv4 --resolve service.udpfile.com:443:$anycast --retry 3 -s -X POST -d ''20210825-$anycast-$max'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o temp.txt + curl --ipv4 --resolve service.udpfile.com:443:$anycast --retry 3 -s -X POST -d ''20210903-$anycast-$max'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o temp.txt publicip=$(cat temp.txt | grep publicip= | cut -f 2- -d'=') colo=$(cat temp.txt | grep colo= | cut -f 2- -d'=') rm -rf temp.txt diff --git a/shell/cf.sh b/shell/cf.sh index 261cd74..b94b236 100644 --- a/shell/cf.sh +++ b/shell/cf.sh @@ -1,5 +1,5 @@ #!/bin/bash -# random cloudflare anycast ip +# better-cloudflare-ip declare -i bandwidth declare -i speed read -p "请设置期望到 CloudFlare 服务器的带宽大小(单位 Mbps):" bandwidth @@ -24,12 +24,12 @@ do do if [ ! -f "meta.txt" ] then - curl --ipv4 --resolve speed.cloudflare.com:443:$resolveip --retry 3 -v https://speed.cloudflare.com/__down>meta.txt 2>&1 + curl --ipv4 --resolve speed.cloudflare.com:443:$resolveip --retry 3 -s https://speed.cloudflare.com/meta | sed -e 's/{//g' -e 's/}//g' -e 's/"//g' -e 's/,/\n/g'>meta.txt else - asn=$(cat meta.txt | grep cf-meta-asn: | tr '\r' '\n' | awk '{print $3}') - city=$(cat meta.txt | grep cf-meta-city: | tr '\r' '\n' | awk '{print $3}') - latitude=$(cat meta.txt | grep cf-meta-latitude: | tr '\r' '\n' | awk '{print $3}') - longitude=$(cat meta.txt | grep cf-meta-longitude: | tr '\r' '\n' | awk '{print $3}') + asn=$(cat meta.txt | grep asn: | awk -F: '{print $2}') + city=$(cat meta.txt | grep city: | awk -F: '{print $2}') + latitude=$(cat meta.txt | grep latitude: | awk -F: '{print $2}') + longitude=$(cat meta.txt | grep longitude: | awk -F: '{print $2}') curl --ipv4 --resolve service.udpfile.com:443:$resolveip --retry 3 "https://service.udpfile.com?asn="$asn"&city="$city"" -o data.txt -# break fi @@ -40,12 +40,12 @@ do do if [ ! -f "meta.txt" ] then - curl --ipv4 --retry 3 -v https://speed.cloudflare.com/__down>meta.txt 2>&1 + curl --ipv4 --retry 3 -s https://speed.cloudflare.com/meta | sed -e 's/{//g' -e 's/}//g' -e 's/"//g' -e 's/,/\n/g'>meta.txt else - asn=$(cat meta.txt | grep cf-meta-asn: | tr '\r' '\n' | awk '{print $3}') - city=$(cat meta.txt | grep cf-meta-city: | tr '\r' '\n' | awk '{print $3}') - latitude=$(cat meta.txt | grep cf-meta-latitude: | tr '\r' '\n' | awk '{print $3}') - longitude=$(cat meta.txt | grep cf-meta-longitude: | tr '\r' '\n' | awk '{print $3}') + asn=$(cat meta.txt | grep asn: | awk -F: '{print $2}') + city=$(cat meta.txt | grep city: | awk -F: '{print $2}') + latitude=$(cat meta.txt | grep latitude: | awk -F: '{print $2}') + longitude=$(cat meta.txt | grep longitude: | awk -F: '{print $2}') curl --ipv4 --retry 3 "https://service.udpfile.com?asn="$asn"&city="$city"" -o data.txt -# break fi @@ -60,7 +60,7 @@ do file=$(cat data.txt | grep file= | cut -f 2- -d'=') url=$(cat data.txt | grep url= | cut -f 2- -d'=') app=$(cat data.txt | grep app= | cut -f 2- -d'=') - if [ "$app" != "20210825" ] + if [ "$app" != "20210903" ] then echo 发现新版本程序: $app echo 更新地址: $url @@ -198,9 +198,9 @@ do echo 峰值速度 $max kB/s if [ $max1 -ge $max2 ] then - curl --ipv4 --resolve service.udpfile.com:443:$first --retry 3 -s -X POST -d ''20210825-$first-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$first --retry 3 -s -X POST -d ''20210903-$first-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 else - curl --ipv4 --resolve service.udpfile.com:443:$first --retry 3 -s -X POST -d ''20210825-$first-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$first --retry 3 -s -X POST -d ''20210903-$first-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 fi echo 第一次测试 $second curl --resolve $domain:443:$second https://$domain/$file -o /dev/null --connect-timeout 5 --max-time 10 > log.txt 2>&1 @@ -274,9 +274,9 @@ do echo 峰值速度 $max kB/s if [ $max1 -ge $max2 ] then - curl --ipv4 --resolve service.udpfile.com:443:$second --retry 3 -s -X POST -d ''20210825-$second-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$second --retry 3 -s -X POST -d ''20210903-$second-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 else - curl --ipv4 --resolve service.udpfile.com:443:$second --retry 3 -s -X POST -d ''20210825-$second-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$second --retry 3 -s -X POST -d ''20210903-$second-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 fi echo 第一次测试 $third curl --resolve $domain:443:$third https://$domain/$file -o /dev/null --connect-timeout 5 --max-time 10 > log.txt 2>&1 @@ -350,9 +350,9 @@ do echo 峰值速度 $max kB/s if [ $max1 -ge $max2 ] then - curl --ipv4 --resolve service.udpfile.com:443:$third --retry 3 -s -X POST -d ''20210825-$third-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$third --retry 3 -s -X POST -d ''20210903-$third-$max1'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 else - curl --ipv4 --resolve service.udpfile.com:443:$third --retry 3 -s -X POST -d ''20210825-$third-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 + curl --ipv4 --resolve service.udpfile.com:443:$third --retry 3 -s -X POST -d ''20210903-$third-$max2'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o /dev/null --connect-timeout 5 --max-time 10 fi fi done @@ -365,7 +365,7 @@ done start_seconds=$(date --date="$starttime" +%s) end_seconds=$(date --date="$endtime" +%s) clear - curl --ipv4 --resolve service.udpfile.com:443:$anycast --retry 3 -s -X POST -d ''20210825-$anycast-$max'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o temp.txt + curl --ipv4 --resolve service.udpfile.com:443:$anycast --retry 3 -s -X POST -d ''20210903-$anycast-$max'' "https://service.udpfile.com?asn="$asn"&city="$city"" -o temp.txt publicip=$(cat temp.txt | grep publicip= | cut -f 2- -d'=') colo=$(cat temp.txt | grep colo= | cut -f 2- -d'=') rm -rf temp.txt diff --git "a/windows/CF\344\274\230\351\200\211IP.bat" "b/windows/CF\344\274\230\351\200\211IP.bat" index d41ff33..76b03b8 100644 --- "a/windows/CF\344\274\230\351\200\211IP.bat" +++ "b/windows/CF\344\274\230\351\200\211IP.bat" @@ -14,22 +14,33 @@ goto start del data.txt ip.txt CR.txt CRLF.txt cut.txt speed.txt meta.txt RD /S /Q temp cls +set LF=^ + + if exist "resolve.txt" goto resolve if not exist "resolve.txt" goto dnsresolve :dnsresolve title DNSȡCFڵIP -curl --ipv4 --retry 3 -v https://speed.cloudflare.com/__down>meta.txt 2>&1 -for /f "tokens=3 delims= " %%i in ('findstr "cf-meta-asn:" meta.txt') do ( -set asn=%%i +for %%i in ("!LF!") do ( + for /f "delims=" %%a in ('curl --ipv4 --retry 3 -s https://speed.cloudflare.com/meta') do ( + set str=%%a + set str=!str:{=! + set str=!str:}=! + set str=!str:"=! + echo !str:,=%%~i! + ) +)>meta.txt +for /f "tokens=2 delims=:" %%i in ('findstr "asn:" meta.txt') do ( + set asn=%%i ) -for /f "tokens=3 delims= " %%i in ('findstr "cf-meta-city:" meta.txt') do ( -set city=%%i +for /f "tokens=2 delims=:" %%i in ('findstr "city:" meta.txt') do ( + set city=%%i ) -for /f "tokens=3 delims= " %%i in ('findstr "cf-meta-latitude:" meta.txt') do ( -set latitude=%%i +for /f "tokens=2 delims=:" %%i in ('findstr "latitude:" meta.txt') do ( + set latitude=%%i ) -for /f "tokens=3 delims= " %%i in ('findstr "cf-meta-longitude:" meta.txt') do ( -set longitude=%%i +for /f "tokens=2 delims=:" %%i in ('findstr "longitude:" meta.txt') do ( + set longitude=%%i ) curl --ipv4 --retry 3 https://service.udpfile.com?asn=%asn%^&city=%city% -o data.txt -# goto getip @@ -38,18 +49,26 @@ for /f "delims=" %%i in (resolve.txt) do ( set resolveip=%%i ) title ָȡCFڵIP -curl --ipv4 --resolve speed.cloudflare.com:443:%resolveip% --retry 3 -v https://speed.cloudflare.com/__down>meta.txt 2>&1 -for /f "tokens=3 delims= " %%i in ('findstr "cf-meta-asn:" meta.txt') do ( -set asn=%%i +for %%i in ("!LF!") do ( + for /f "delims=" %%a in ('curl --ipv4 --resolve speed.cloudflare.com:443:%resolveip% --retry 3 -s https://speed.cloudflare.com/meta') do ( + set str=%%a + set str=!str:{=! + set str=!str:}=! + set str=!str:"=! + echo !str:,=%%~i! + ) +)>meta.txt +for /f "tokens=2 delims=:" %%i in ('findstr "asn:" meta.txt') do ( + set asn=%%i ) -for /f "tokens=3 delims= " %%i in ('findstr "cf-meta-city:" meta.txt') do ( -set city=%%i +for /f "tokens=2 delims=:" %%i in ('findstr "city:" meta.txt') do ( + set city=%%i ) -for /f "tokens=3 delims= " %%i in ('findstr "cf-meta-latitude:" meta.txt') do ( -set latitude=%%i +for /f "tokens=2 delims=:" %%i in ('findstr "latitude:" meta.txt') do ( + set latitude=%%i ) -for /f "tokens=3 delims= " %%i in ('findstr "cf-meta-longitude:" meta.txt') do ( -set longitude=%%i +for /f "tokens=2 delims=:" %%i in ('findstr "longitude:" meta.txt') do ( + set longitude=%%i ) curl --ipv4 --resolve service.udpfile.com:443:%resolveip% --retry 3 https://service.udpfile.com?asn=%asn%^&city=%city% -o data.txt -# if not exist "data.txt" goto start @@ -70,7 +89,7 @@ set url=%%a ) for /f "tokens=2 delims==" %%a in ('findstr /C:"app" data.txt') do ( set app=%%a -if !app! NEQ 20210825 (echo °汾: !app!&echo µַ: !url!&title ºſʹ&echo ˳&pause>nul&exit) +if !app! NEQ 20210903 (echo °汾: !app!&echo µַ: !url!&title ºſʹ&echo ˳&pause>nul&exit) ) del data.txt title ICMP @@ -248,7 +267,7 @@ if !max! GEQ !speed! (cls&set anycast=!a!&goto end) else (goto three) chcp 936 del CRLF.txt cut.txt speed.txt cls -if !max1! GEQ !max2! (curl --ipv4 --resolve service.udpfile.com:443:!a! --retry 3 -s -X POST -d "20210825-!a!-!max1!" https://service.udpfile.com?asn=%asn%^&city=%city% -o nul --connect-timeout 5 --max-time 10) else (curl --ipv4 --resolve service.udpfile.com:443:!a! --retry 3 -s -X POST -d "20210825-!a!-!max2!" https://service.udpfile.com?asn=%asn%^&city=%city% -o nul --connect-timeout 5 --max-time 10) +if !max1! GEQ !max2! (curl --ipv4 --resolve service.udpfile.com:443:!a! --retry 3 -s -X POST -d "20210903-!a!-!max1!" https://service.udpfile.com?asn=%asn%^&city=%city% -o nul --connect-timeout 5 --max-time 10) else (curl --ipv4 --resolve service.udpfile.com:443:!a! --retry 3 -s -X POST -d "20210903-!a!-!max2!" https://service.udpfile.com?asn=%asn%^&city=%city% -o nul --connect-timeout 5 --max-time 10) echo ڶβ !a! ,ֵٶ !max! kB/s echo һβ !b! curl --resolve !domain!:443:!b! https://!domain!/!file! -o nul --connect-timeout 5 --max-time 10 > CR.txt 2>&1 @@ -333,7 +352,7 @@ if !max! GEQ !speed! (cls&set anycast=!b!&goto end) else (goto five) chcp 936 del CRLF.txt cut.txt speed.txt cls -if !max1! GEQ !max2! (curl --ipv4 --resolve service.udpfile.com:443:!b! --retry 3 -s -X POST -d "20210825-!b!-!max1!" https://service.udpfile.com?asn=%asn%^&city=%city% -o nul --connect-timeout 5 --max-time 10) else (curl --ipv4 --resolve service.udpfile.com:443:!b! --retry 3 -s -X POST -d "20210825-!b!-!max2!" https://service.udpfile.com?asn=%asn%^&city=%city% -o nul --connect-timeout 5 --max-time 10) +if !max1! GEQ !max2! (curl --ipv4 --resolve service.udpfile.com:443:!b! --retry 3 -s -X POST -d "20210903-!b!-!max1!" https://service.udpfile.com?asn=%asn%^&city=%city% -o nul --connect-timeout 5 --max-time 10) else (curl --ipv4 --resolve service.udpfile.com:443:!b! --retry 3 -s -X POST -d "20210903-!b!-!max2!" https://service.udpfile.com?asn=%asn%^&city=%city% -o nul --connect-timeout 5 --max-time 10) echo ڶβ !b! ,ֵٶ !max! kB/s echo һβ !c! curl --resolve !domain!:443:!c! https://!domain!/!file! -o nul --connect-timeout 5 --max-time 10 > CR.txt 2>&1 @@ -419,7 +438,7 @@ chcp 936 del CRLF.txt cut.txt speed.txt cls echo ڶβ !c! ,ֵٶ !max! kB/s -if !max1! GEQ !max2! (curl --ipv4 --resolve service.udpfile.com:443:!c! --retry 3 -s -X POST -d "20210825-!c!-!max1!" https://service.udpfile.com?asn=%asn%^&city=%city% -o nul --connect-timeout 5 --max-time 10) else (curl --ipv4 --resolve service.udpfile.com:443:!c! --retry 3 -s -X POST -d "20210825-!c!-!max2!" https://service.udpfile.com?asn=%asn%^&city=%city% -o nul --connect-timeout 5 --max-time 10) +if !max1! GEQ !max2! (curl --ipv4 --resolve service.udpfile.com:443:!c! --retry 3 -s -X POST -d "20210903-!c!-!max1!" https://service.udpfile.com?asn=%asn%^&city=%city% -o nul --connect-timeout 5 --max-time 10) else (curl --ipv4 --resolve service.udpfile.com:443:!c! --retry 3 -s -X POST -d "20210903-!c!-!max2!" https://service.udpfile.com?asn=%asn%^&city=%city% -o nul --connect-timeout 5 --max-time 10) goto start :end set /a realbandwidth=max/128 @@ -429,7 +448,7 @@ if %time:~6,1% EQU 0 (set /a stopS=%time:~7,1%) else (set /a stopS=%time:~6,2%) set /a starttime=%startH%*3600+%startM%*60+%startS% set /a stoptime=%stopH%*3600+%stopM%*60+%stopS% if %starttime% GTR %stoptime% (set /a alltime=86400-%starttime%+%stoptime%) else (set /a alltime=%stoptime%-%starttime%) -curl --ipv4 --resolve service.udpfile.com:443:!anycast! --retry 3 -s -X POST -d "20210825-!anycast!-!max!" https://service.udpfile.com?asn=%asn%^&city=%city% -o data.txt +curl --ipv4 --resolve service.udpfile.com:443:!anycast! --retry 3 -s -X POST -d "20210903-!anycast!-!max!" https://service.udpfile.com?asn=%asn%^&city=%city% -o data.txt for /f "tokens=2 delims==" %%a in ('findstr /C:"publicip" data.txt') do ( set publicip=%%a )