Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions fancyss/scripts/ss_node_subscribe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6543,21 +6543,21 @@ download_by_curl(){
local UA=$(get_ua)
if [ -n "${UA}" ];then
echo_date "🪧使用UA:$UA"
local UA_ARG="--user-agent ${UA}"
set -- --user-agent "${UA}"
else
echo_date "🪧使用UA:curl"
local UA_ARG=""
set --
fi

if [ ! -L "/tmp/curl-update" ];then
ln -sf /koolshare/bin/curl-fancyss /tmp/curl-subscribe
fi

if [ "${SUB_BY_PROXY}" == "0" ]; then
# 先直连下载
echo_date "➡️通过本地网络直连下载订阅..."
rm -f "${header_file}" >/dev/null 2>&1
run /tmp/curl-subscribe -sSk -L ${UA_ARG} -D "${header_file}" --connect-timeout 5 -m 5 --retry 3 --retry-delay 1 "${url_encode}" 2>/dev/null >${DIR}/sub_file_encode_${SUB_LINK_HASH:0:4}.txt
run /tmp/curl-subscribe -sSk -L "$@" -D "${header_file}" --connect-timeout 5 -m 5 --retry 3 --retry-delay 1 "${url_encode}" 2>/dev/null >${DIR}/sub_file_encode_${SUB_LINK_HASH:0:4}.txt
if [ "$?" == "0" ]; then
return 0
fi
Expand All @@ -6568,7 +6568,7 @@ download_by_curl(){
if [ -n "${SOCKS5_OPEN}" ];then
echo_date "✈️使用当前$(get_type_name "$(sub_get_node_field_plain "${CURR_NODE}" type)")节点:[$(sub_get_node_field_plain "${CURR_NODE}" name)]提供的网络下载..."
rm -f "${header_file}" >/dev/null 2>&1
run /tmp/curl-subscribe -sSk -L ${UA_ARG} -D "${header_file}" --connect-timeout 5 -m 5 -x socks5h://127.0.0.1:23456 --retry 3 --retry-delay 1 "${url_encode}" 2>/dev/null >${DIR}/sub_file_encode_${SUB_LINK_HASH:0:4}.txt
run /tmp/curl-subscribe -sSk -L "$@" -D "${header_file}" --connect-timeout 5 -m 5 -x socks5h://127.0.0.1:23456 --retry 3 --retry-delay 1 "${url_encode}" 2>/dev/null >${DIR}/sub_file_encode_${SUB_LINK_HASH:0:4}.txt
return $?
else
echo_date "⚠️当前$(get_type_name "$(sub_get_node_field_plain "${CURR_NODE}" type)")节点工作异常,结束curl订阅下载!"
Expand All @@ -6581,7 +6581,7 @@ download_by_curl(){
local EXT_ARG="-x socks5h://127.0.0.1:23456"
echo_date "✈️使用当前$(get_type_name "$(sub_get_node_field_plain "${CURR_NODE}" type)")节点:[$(sub_get_node_field_plain "${CURR_NODE}" name)]提供的网络下载..."
rm -f "${header_file}" >/dev/null 2>&1
run /tmp/curl-subscribe -sSk -L ${UA_ARG} -D "${header_file}" --connect-timeout 5 -m 5 -x socks5h://127.0.0.1:23456 --retry 3 --retry-delay 1 "${url_encode}" 2>/dev/null >${DIR}/sub_file_encode_${SUB_LINK_HASH:0:4}.txt
run /tmp/curl-subscribe -sSk -L "$@" -D "${header_file}" --connect-timeout 5 -m 5 -x socks5h://127.0.0.1:23456 --retry 3 --retry-delay 1 "${url_encode}" 2>/dev/null >${DIR}/sub_file_encode_${SUB_LINK_HASH:0:4}.txt
return $?
else
local EXT_ARG=""
Expand All @@ -6592,7 +6592,7 @@ download_by_curl(){
# 直连下载
echo_date "⬇️使用常规网络下载..."
rm -f "${header_file}" >/dev/null 2>&1
run /tmp/curl-subscribe -sSk -L ${UA_ARG} -D "${header_file}" --connect-timeout 5 -m 5 --retry 3 --retry-delay 1 "${url_encode}" 2>/dev/null >${DIR}/sub_file_encode_${SUB_LINK_HASH:0:4}.txt
run /tmp/curl-subscribe -sSk -L "$@" -D "${header_file}" --connect-timeout 5 -m 5 --retry 3 --retry-delay 1 "${url_encode}" 2>/dev/null >${DIR}/sub_file_encode_${SUB_LINK_HASH:0:4}.txt
return $?
fi
}
Expand Down