Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
woniuzfb committed Mar 19, 2024
1 parent 60b29b7 commit 4d64376
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 92 deletions.
2 changes: 1 addition & 1 deletion core
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ CurlFake()
"${CURL_IMPERSONATE_FILE}-$service_name" "$@"
return 0
fi
curl-impersonate "$@"
$CURL_IMPERSONATE_FILE "$@"
}

SetDelimiters()
Expand Down
43 changes: 23 additions & 20 deletions docs/iptv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ dim_underlined='\033[37;4;2m'
indent_6='\r\033[6C'
indent_20='\r\033[20C'

shopt -s extglob

Println()
{
printf '\n%b\n' "$1"
Expand Down Expand Up @@ -27716,7 +27718,7 @@ OpenrestyInstall()
mv $openssl_name $openssl_name-patched
cd $openssl_name-patched
curl -s -L "$FFMPEG_MIRROR_LINK/openssl-1.1.1f-sess_set_get_cb_yield.patch" -o openssl-1.1.1f-sess_set_get_cb_yield.patch
patch -p1 < openssl-1.1.1f-sess_set_get_cb_yield.patch >/dev/null 2>&1
patch -p1 < openssl-1.1.1f-sess_set_get_cb_yield.patch >/dev/null 2>&1 || true
cd ~
fi

Expand All @@ -27725,7 +27727,7 @@ OpenrestyInstall()
cd "$openresty_package_name/bundle/ngx_lua-"*

curl -s -L "$FFMPEG_MIRROR_LINK/fix_ngx_lua_resp_get_headers_key_whitespace.patch" -o fix_ngx_lua_resp_get_headers_key_whitespace.patch
patch -p1 < fix_ngx_lua_resp_get_headers_key_whitespace.patch >/dev/null 2>&1
patch -p1 < fix_ngx_lua_resp_get_headers_key_whitespace.patch >/dev/null 2>&1 || true

cd ../..

Expand Down Expand Up @@ -27896,30 +27898,31 @@ NginxInstall()
fi
fi

while IFS= read -r line
do
if [ "$openssl_options_index" -eq 0 ]
then
if [[ $line == *"openssl-1."* ]]
then
openssl_name=${line#*<a href=\"}
openssl_name=${openssl_name%%.tar.gz*}
break
fi
else
if [[ $line == *"openssl-3.0"* ]]
if [ "$openssl_options_index" -eq 0 ]
then
openssl_url="https://www.openssl.org/source/old"
openssl_vers=($(curl -s -Lm 20 $openssl_url/ | grep -oP '<li><a href="[^"]+">\K[^<]+'))

for openssl_ver in "${openssl_vers[@]}"
do
if [ "${openssl_ver%%.*}" -eq 1 ]
then
openssl_name=${line#*<a href=\"}
openssl_name=${openssl_name%%.tar.gz*}
break
fi
fi
done < <(curl -s -L -H "User-Agent: $USER_AGENT_BROWSER" https://www.openssl.org/source/ 2> /dev/null)
done
openssl_url="$openssl_url/$openssl_ver"
else
openssl_url="https://www.openssl.org/source"
fi

openssl_packs=($(curl -s -Lm 20 $openssl_url/ | grep -oP '<td><a href="[^"]+">\K[^<]+'))
openssl_pack="${openssl_packs[0]}"
openssl_name=${openssl_pack%.tar*}

if [ ! -d "./$openssl_name" ]
then
curl -s -L "https://www.openssl.org/source/$openssl_name.tar.gz" -o "$openssl_name.tar.gz"
tar xzf "$openssl_name.tar.gz"
curl -s -L "$openssl_url/$openssl_pack" -o "$openssl_pack"
tar xzf "$openssl_pack"
fi

echo -n "...60%..."
Expand Down
43 changes: 23 additions & 20 deletions iptv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ dim_underlined='\033[37;4;2m'
indent_6='\r\033[6C'
indent_20='\r\033[20C'

shopt -s extglob

Println()
{
printf '\n%b\n' "$1"
Expand Down Expand Up @@ -27716,7 +27718,7 @@ OpenrestyInstall()
mv $openssl_name $openssl_name-patched
cd $openssl_name-patched
curl -s -L "$FFMPEG_MIRROR_LINK/openssl-1.1.1f-sess_set_get_cb_yield.patch" -o openssl-1.1.1f-sess_set_get_cb_yield.patch
patch -p1 < openssl-1.1.1f-sess_set_get_cb_yield.patch >/dev/null 2>&1
patch -p1 < openssl-1.1.1f-sess_set_get_cb_yield.patch >/dev/null 2>&1 || true
cd ~
fi

Expand All @@ -27725,7 +27727,7 @@ OpenrestyInstall()
cd "$openresty_package_name/bundle/ngx_lua-"*

curl -s -L "$FFMPEG_MIRROR_LINK/fix_ngx_lua_resp_get_headers_key_whitespace.patch" -o fix_ngx_lua_resp_get_headers_key_whitespace.patch
patch -p1 < fix_ngx_lua_resp_get_headers_key_whitespace.patch >/dev/null 2>&1
patch -p1 < fix_ngx_lua_resp_get_headers_key_whitespace.patch >/dev/null 2>&1 || true

cd ../..

Expand Down Expand Up @@ -27896,30 +27898,31 @@ NginxInstall()
fi
fi

while IFS= read -r line
do
if [ "$openssl_options_index" -eq 0 ]
then
if [[ $line == *"openssl-1."* ]]
then
openssl_name=${line#*<a href=\"}
openssl_name=${openssl_name%%.tar.gz*}
break
fi
else
if [[ $line == *"openssl-3.0"* ]]
if [ "$openssl_options_index" -eq 0 ]
then
openssl_url="https://www.openssl.org/source/old"
openssl_vers=($(curl -s -Lm 20 $openssl_url/ | grep -oP '<li><a href="[^"]+">\K[^<]+'))

for openssl_ver in "${openssl_vers[@]}"
do
if [ "${openssl_ver%%.*}" -eq 1 ]
then
openssl_name=${line#*<a href=\"}
openssl_name=${openssl_name%%.tar.gz*}
break
fi
fi
done < <(curl -s -L -H "User-Agent: $USER_AGENT_BROWSER" https://www.openssl.org/source/ 2> /dev/null)
done
openssl_url="$openssl_url/$openssl_ver"
else
openssl_url="https://www.openssl.org/source"
fi

openssl_packs=($(curl -s -Lm 20 $openssl_url/ | grep -oP '<td><a href="[^"]+">\K[^<]+'))
openssl_pack="${openssl_packs[0]}"
openssl_name=${openssl_pack%.tar*}

if [ ! -d "./$openssl_name" ]
then
curl -s -L "https://www.openssl.org/source/$openssl_name.tar.gz" -o "$openssl_name.tar.gz"
tar xzf "$openssl_name.tar.gz"
curl -s -L "$openssl_url/$openssl_pack" -o "$openssl_pack"
tar xzf "$openssl_pack"
fi

echo -n "...60%..."
Expand Down
6 changes: 3 additions & 3 deletions scripts/fix_ngx_lua_resp_get_headers_key_whitespace.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/ngx_http_lua_headers.c b/src/ngx_http_lua_headers.c
index d8d5edc8..5466ae47 100644
index 85836a1..ea526af 100644
--- a/src/ngx_http_lua_headers.c
+++ b/src/ngx_http_lua_headers.c
@@ -417,7 +417,7 @@ ngx_http_lua_ngx_resp_get_headers(lua_State *L)
@@ -429,7 +429,7 @@ ngx_http_lua_ngx_resp_get_headers(lua_State *L)
ngx_http_lua_ctx_t *ctx;
u_char *lowcase_key = NULL;
size_t lowcase_key_sz = 0;
Expand All @@ -11,7 +11,7 @@ index d8d5edc8..5466ae47 100644
int n;
int max;
int raw = 0;
@@ -556,6 +556,29 @@ ngx_http_lua_ngx_resp_get_headers(lua_State *L)
@@ -568,6 +568,29 @@ ngx_http_lua_ngx_resp_get_headers(lua_State *L)
continue;
}

Expand Down
12 changes: 6 additions & 6 deletions scripts/node-libcurl-impersonate.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ index a12448b..3ee0452 100644
tsconfig.tsbuildinfo
website/
diff --git a/lib/Curl.ts b/lib/Curl.ts
index d2a419c..5d44ba3 100644
index 14013df..7f89018 100644
--- a/lib/Curl.ts
+++ b/lib/Curl.ts
@@ -69,7 +69,7 @@ import { CurlReadFunc } from './enum/CurlReadFunc'
Expand Down Expand Up @@ -64,22 +64,22 @@ index 9bba413..bccbb1e 100644
/**
* This is a Node.js wrapper around the binding {@link EasyNativeBinding | native Easy class}.
diff --git a/package.json b/package.json
index 15071fd..49350a8 100644
index 4d392fc..633a602 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
- "name": "node-libcurl",
+ "name": "node-libcurl-impersonate",
"version": "3.0.0",
"version": "4.0.0",
- "description": "The fastest http(s) client (and much more) for Node.js - Node.js bindings for libcurl",
+ "description": "The fastest http(s) client (and much more) for Node.js - Node.js bindings for libcurl (curl-impersonate)",
"keywords": [
"node-curl",
"curl",
@@ -23,7 +23,7 @@
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -30,7 +30,7 @@
"LIBCURL_VERSION_WIN_DEPS"
],
"binary": {
- "module_name": "node_libcurl",
+ "module_name": "node_libcurl-impersonate",
Expand Down
6 changes: 3 additions & 3 deletions src/lhh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ LhhDownload()
ZhLhhDownload()
{
local book_url="$1" title="$2" i j
local book_path="$save_dir/$title"
local book_path="$save_dir/${title//\//_}"

i=2
until [ ! -d "$book_path" ]
Expand Down Expand Up @@ -465,7 +465,7 @@ reduce ({adapter,addtime,bookname,category_id,cover,drawing,m,muludir,original,p
HdlzZhihuDownload()
{
local id=$1 title=$2 i j
local book_path="$save_dir/$title"
local book_path="$save_dir/${title//\//_}"
shift 2

i=2
Expand Down Expand Up @@ -548,7 +548,7 @@ HdlzZhihuDownload()
HdlzToutiaoDownload()
{
local id=$1 title=$2 i j
local book_path="$save_dir/$title"
local book_path="$save_dir/${title//\//_}"

i=2
until [ ! -d "$book_path" ]
Expand Down
47 changes: 26 additions & 21 deletions src/nx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ NginxInstall()

if [ "$dist" == "mac" ] && [ ! -d /usr/local/nginx ]
then
Println "$info 建立目录 /usr/local/nginx\n"
Println "$info 建立目录 /usr/local/nginx, 可能需要输入密码\n"
sudo mkdir /usr/local/nginx
sudo chown $USER /usr/local/nginx
fi
Expand Down Expand Up @@ -261,30 +261,31 @@ NginxInstall()
fi
fi

while IFS= read -r line
do
if [ "$openssl_options_index" -eq 0 ]
then
if [[ $line == *"openssl-1."* ]]
then
openssl_name=${line#*<a href=\"}
openssl_name=${openssl_name%%.tar.gz*}
break
fi
else
if [[ $line == *"openssl-3.0"* ]]
if [ "$openssl_options_index" -eq 0 ]
then
openssl_url="https://www.openssl.org/source/old"
openssl_vers=($(curl -s -Lm 20 $openssl_url/ | grep -oP '<li><a href="[^"]+">\K[^<]+'))

for openssl_ver in "${openssl_vers[@]}"
do
if [ "${openssl_ver%%.*}" -eq 1 ]
then
openssl_name=${line#*<a href=\"}
openssl_name=${openssl_name%%.tar.gz*}
break
fi
fi
done < <(curl -s -L -H "User-Agent: $USER_AGENT_BROWSER" https://www.openssl.org/source/ 2> /dev/null)
done
openssl_url="$openssl_url/$openssl_ver"
else
openssl_url="https://www.openssl.org/source"
fi

openssl_packs=($(curl -s -Lm 20 $openssl_url/ | grep -oP '<td><a href="[^"]+">\K[^<]+'))
openssl_pack="${openssl_packs[0]}"
openssl_name=${openssl_pack%.tar*}

if [ ! -d "./$openssl_name" ]
then
curl -s -L "https://www.openssl.org/source/$openssl_name.tar.gz" -o "$openssl_name.tar.gz"
tar xzf "$openssl_name.tar.gz"
curl -s -L "$openssl_url/$openssl_pack" -o "$openssl_pack"
tar xzf "$openssl_pack"
fi

echo -n "...60%..."
Expand Down Expand Up @@ -469,14 +470,15 @@ Println " nginx 管理面板 ${normal}${red}[v$sh_ver]${normal}
${green}11.${normal} 开关
${green}12.${normal} 重启
————————————
${green}13.${normal} 配置 日志切割
${green}13.${normal} 配置 vim
${green}14.${normal} 配置 nodejs
${green}15.${normal} 配置 mongodb
${green}16.${normal} 配置 postfix
${green}17.${normal} 配置 mmproxy
${green}18.${normal} 配置 dnscrypt proxy
${green}19.${normal} 识别 cloudflare/ibm ip
${green}20.${normal} 删除域名
${green}21.${normal} 日志切割

${tip} 输入: nx 打开面板

Expand Down Expand Up @@ -529,7 +531,7 @@ case "$nginx_num" in
NginxRestart
;;
13)
NginxLogRotate
VimConfig
;;
14)
NodejsMenu
Expand All @@ -552,6 +554,9 @@ case "$nginx_num" in
20)
NginxDeleteDomain
;;
21)
NginxLogRotate
;;
*) Println "$error $i18n_input_correct_number [1-20]\n"
;;
esac
Expand Down
16 changes: 8 additions & 8 deletions src/or
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ OpenrestyInstall()

if [ "$dist" == "mac" ] && [ ! -d /usr/local/openresty ]
then
Println "$info 建立目录 /usr/local/openresty\n"
Println "$info 建立目录 /usr/local/openresty, 可能需要输入密码\n"
sudo mkdir /usr/local/openresty
sudo chown $USER /usr/local/openresty
fi
Expand Down Expand Up @@ -178,7 +178,7 @@ OpenrestyInstall()
cd "$openresty_package_name/bundle/ngx_lua-"*

curl -s -L "$FFMPEG_MIRROR_LINK/fix_ngx_lua_resp_get_headers_key_whitespace.patch" -o fix_ngx_lua_resp_get_headers_key_whitespace.patch
patch -p1 < fix_ngx_lua_resp_get_headers_key_whitespace.patch >/dev/null 2>&1
patch -p1 < fix_ngx_lua_resp_get_headers_key_whitespace.patch >/dev/null 2>&1 || true

cd ../../

Expand Down Expand Up @@ -309,12 +309,12 @@ OpenrestyInstall()
then
rm -rf ${openssl_name}
rm -rf ${openssl_name}-patched
curl -s -L https://www.openssl.org/source/$openssl_name.tar.gz -o $openssl_name.tar.gz
tar xzf $openssl_name.tar.gz
mv $openssl_name $openssl_name-patched
cd $openssl_name-patched
curl -s -L https://www.openssl.org/source/old/1.1.1/${openssl_name}.tar.gz -o ${openssl_name}.tar.gz
tar xzf ${openssl_name}.tar.gz
mv ${openssl_name} ${openssl_name}-patched
cd ${openssl_name}-patched
curl -s -L "$FFMPEG_MIRROR_LINK/openssl-1.1.1f-sess_set_get_cb_yield.patch" -o openssl-1.1.1f-sess_set_get_cb_yield.patch
patch -p1 < openssl-1.1.1f-sess_set_get_cb_yield.patch >/dev/null 2>&1
patch -p1 < openssl-1.1.1f-sess_set_get_cb_yield.patch >/dev/null 2>&1 || true
cd ~
fi

Expand All @@ -323,7 +323,7 @@ OpenrestyInstall()
cd "$openresty_package_name/bundle/ngx_lua-"*

curl -s -L "$FFMPEG_MIRROR_LINK/fix_ngx_lua_resp_get_headers_key_whitespace.patch" -o fix_ngx_lua_resp_get_headers_key_whitespace.patch
patch -p1 < fix_ngx_lua_resp_get_headers_key_whitespace.patch >/dev/null 2>&1
patch -p1 < fix_ngx_lua_resp_get_headers_key_whitespace.patch >/dev/null 2>&1 || true

cd ../..

Expand Down
Loading

0 comments on commit 4d64376

Please sign in to comment.