Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
woniuzfb committed Mar 20, 2024
1 parent 60b29b7 commit 6d87458
Show file tree
Hide file tree
Showing 12 changed files with 268 additions and 262 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
45 changes: 24 additions & 21 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 @@ -22537,7 +22539,7 @@ TsMenu()

AntiDDoSSet()
{
if [ -x "$(command -v ufw)" ] && [ -s "$nginx_prefix/logs/access.log" ] && ls -A $LIVE_ROOT/* > /dev/null 2>&1
if [[ -x "$(command -v ufw)" ]] && [ -s "$nginx_prefix/logs/access.log" ] && ls -A $LIVE_ROOT/* > /dev/null 2>&1
then
sleep 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
45 changes: 24 additions & 21 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 @@ -22537,7 +22539,7 @@ TsMenu()

AntiDDoSSet()
{
if [ -x "$(command -v ufw)" ] && [ -s "$nginx_prefix/logs/access.log" ] && ls -A $LIVE_ROOT/* > /dev/null 2>&1
if [[ -x "$(command -v ufw)" ]] && [ -s "$nginx_prefix/logs/access.log" ] && ls -A $LIVE_ROOT/* > /dev/null 2>&1
then
sleep 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
2 changes: 1 addition & 1 deletion src/iptv/menu_monitor
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ MonitorMenu()

AntiDDoSSet()
{
if [ -x "$(command -v ufw)" ] && [ -s "$nginx_prefix/logs/access.log" ] && ls -A $LIVE_ROOT/* > /dev/null 2>&1
if [[ -x "$(command -v ufw)" ]] && [ -s "$nginx_prefix/logs/access.log" ] && ls -A $LIVE_ROOT/* > /dev/null 2>&1
then
sleep 1

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
Loading

0 comments on commit 6d87458

Please sign in to comment.