]]
+ then
+ break
+ fi
+ fi
+ done <<< "$bs_html"
+
+ if [ -n "${schedule:-}" ]
+ then
+ file=true
+ file_json=true
+ jq_path='["'"$chnl_id"'"]'
+ JQ update "$SCHEDULE_JSON" schedule
+ Println "$info $chnl_name [$chnl_id] beinsports 节目表更新成功"
+ else
+ Println "$error $chnl_name [$chnl_id] beinsports 节目表更新失败"
+ fi
+ done
+}
+
+ScheduleBeinsportsAu()
+{
+ if [ ! -s "$SCHEDULE_JSON" ]
+ then
+ printf '{"%s":[]}' "beinsports1au" > "$SCHEDULE_JSON"
+ fi
+
+ printf -v today '%(%Y-%m-%d)T' -1
+ sys_time=$(date -d $today +%s)
+ yesterday=$(date --date="yesterday" +"%Y-%m-%d")
+
+ bsau_html=$(curl -s -Lm 20 -H "User-Agent: $USER_AGENT_BROWSER" https://epg.beinsports.com/utctime_au.php?offset=+8&mins=00&id=123)
+
+ for chnl in "${bsau_chnls[@]}"
+ do
+ chnl_id=${chnl%%:*}
+ bsau_id=${chnl#*:}
+ chnl_name=${bsau_id#*:}
+ bsau_id=${bsau_id%%:*}
+
+ schedule=()
+ found=0
+
+ while IFS= read -r line
+ do
+ if [[ $line =~ $bsau_id ]]
+ then
+ found=1
+ elif [ "$found" -eq 1 ]
+ then
+ if [[ $line =~ class=title\>(.+)\ ]]
+ then
+ title="${BASH_REMATCH[1]}"
+ elif [[ $line =~ class=format\>(.+)\ ]]
+ then
+ title="$title - ${BASH_REMATCH[1]}"
+ elif [[ $line =~ class=time\>(.+)\ \;-\ \;(.+)\\ "$SCHEDULE_JSON"
+ fi
+
+ supersport_schedule=$(curl -s -Lm 20 -H "User-Agent: $USER_AGENT_BROWSER" -H "referer: https://supersport.com/tv-guide" "https://supersport.com/api/videos/tv-guide?timestamps[]=$(date -d 01:00:00 +%s)×tamps[]=$(date -d 23:59:59 +%s)&live=false&country_code=ZA")
+
+ for chnl in "${su_chnls[@]}"
+ do
+ chnl_id=${chnl%%:*}
+ chnl_name="${chnl#*:}"
+
+ schedule=$($JQ_FILE --arg chnl_name "$chnl_name" --argjson keys '["title","time","sys_time"]' '.[] | select(.channel == $chnl_name) | .["time"] = (.starts_at|fromdate|strflocaltime("%H:%M")) | .["sys_time"] = (.starts_at|fromdate) | with_entries( select( .key as $k | $keys | index($k) ) )' <<< "$supersport_schedule")
+
+ if [ -n "$schedule" ]
+ then
+ schedule=$($JQ_FILE -s 'unique_by(.sys_time)' <<< "$schedule")
+ json=true
+ jq_path='["'"$chnl_id"'"]'
+ JQ update "$SCHEDULE_JSON" "$schedule"
+ Println "$info $chnl_name [$chnl_id] SuperSport 节目表更新成功"
+ else
+ Println "$error $chnl_name [$chnl_id] SuperSport 节目表更新失败"
+ fi
+ done
+}
+
+ScheduleBtsport()
+{
+ if [ ! -s "$SCHEDULE_JSON" ]
+ then
+ printf '{"%s":[]}' "btsport1" > "$SCHEDULE_JSON"
+ fi
+
+ printf -v today '%(%Y-%m-%d)T' -1
+ yesterday=$(date --date="yesterday" +"%Y-%m-%d")
+
+ bt_prop=$(curl -s -Lm 20 -H "User-Agent: $USER_AGENT_BROWSER" -H "referer: https://www.bt.com/" https://widgets.metabroadcast.com/config/1/btsport_v4.js)
+ bt_prop="${bt_prop#*=}"
+ bt_prop="${bt_prop%;*}"
+ bt_prop="${bt_prop%;*}"
+ bt_channels=$($JQ_FILE -r '.epg.modules.common.channels|join(",")' <<< "$bt_prop")
+ api_key=$($JQ_FILE -r '.epg.modules.common.apiKey' <<< "$bt_prop")
+
+ btsport_schedule=$(curl -s -Lm 20 -H "User-Agent: $USER_AGENT_BROWSER" -H "referer: https://www.bt.com/" "https://users-atlas.metabroadcast.com/4/schedules.json?id=$bt_channels&annotations=channel,content_detail,content.broadcast_channel&from=${yesterday}T16:00:00.000Z&to=${today}T16:00:00.000Z&source=api.youview.tv&key=$api_key")
+
+ for chnl in "${bt_chnls[@]}"
+ do
+ chnl_id=${chnl%%:*}
+ chnl_name="${chnl#*:}"
+
+ schedule=$($JQ_FILE --arg channel_name "$chnl_name" --argjson keys '["title","time","sys_time"]' '.schedules[] | select(.channel.title == $channel_name).entries[] | .["time"] = (.broadcast.transmission_time|sub("(? | \ "$SCHEDULE_JSON"
+ fi
+
+ supersport_schedule=$(curl -s -Lm 20 -H "User-Agent: $USER_AGENT_BROWSER" -H "referer: https://supersport.com/tv-guide" "https://supersport.com/api/videos/tv-guide?timestamps[]=$(date -d 01:00:00 +%s)×tamps[]=$(date -d 23:59:59 +%s)&live=false&country_code=ZA")
+
+ for chnl in "${su_chnls[@]}"
+ do
+ chnl_id=${chnl%%:*}
+ chnl_name="${chnl#*:}"
+
+ schedule=$($JQ_FILE --arg chnl_name "$chnl_name" --argjson keys '["title","time","sys_time"]' '.[] | select(.channel == $chnl_name) | .["time"] = (.starts_at|fromdate|strflocaltime("%H:%M")) | .["sys_time"] = (.starts_at|fromdate) | with_entries( select( .key as $k | $keys | index($k) ) )' <<< "$supersport_schedule")
+
+ if [ -n "$schedule" ]
+ then
+ schedule=$($JQ_FILE -s 'unique_by(.sys_time)' <<< "$schedule")
+ json=true
+ jq_path='["'"$chnl_id"'"]'
+ JQ update "$SCHEDULE_JSON" "$schedule"
+ Println "$info $chnl_name [$chnl_id] SuperSport 节目表更新成功"
+ else
+ Println "$error $chnl_name [$chnl_id] SuperSport 节目表更新失败"
+ fi
+ done
+}
+
+ScheduleBtsport()
+{
+ if [ ! -s "$SCHEDULE_JSON" ]
+ then
+ printf '{"%s":[]}' "btsport1" > "$SCHEDULE_JSON"
+ fi
+
+ printf -v today '%(%Y-%m-%d)T' -1
+ yesterday=$(date --date="yesterday" +"%Y-%m-%d")
+
+ bt_prop=$(curl -s -Lm 20 -H "User-Agent: $USER_AGENT_BROWSER" -H "referer: https://www.bt.com/" https://widgets.metabroadcast.com/config/1/btsport_v4.js)
+ bt_prop="${bt_prop#*=}"
+ bt_prop="${bt_prop%;*}"
+ bt_prop="${bt_prop%;*}"
+ bt_channels=$($JQ_FILE -r '.epg.modules.common.channels|join(",")' <<< "$bt_prop")
+ api_key=$($JQ_FILE -r '.epg.modules.common.apiKey' <<< "$bt_prop")
+
+ btsport_schedule=$(curl -s -Lm 20 -H "User-Agent: $USER_AGENT_BROWSER" -H "referer: https://www.bt.com/" "https://users-atlas.metabroadcast.com/4/schedules.json?id=$bt_channels&annotations=channel,content_detail,content.broadcast_channel&from=${yesterday}T16:00:00.000Z&to=${today}T16:00:00.000Z&source=api.youview.tv&key=$api_key")
+
+ for chnl in "${bt_chnls[@]}"
+ do
+ chnl_id=${chnl%%:*}
+ chnl_name="${chnl#*:}"
+
+ schedule=$($JQ_FILE --arg channel_name "$chnl_name" --argjson keys '["title","time","sys_time"]' '.schedules[] | select(.channel.title == $channel_name).entries[] | .["time"] = (.broadcast.transmission_time|sub("(?.*)\\.[\\d]{3}(?.*)"; "\(.time)Z")|fromdate|strflocaltime("%H:%M")) | .["sys_time"] = (.broadcast.transmission_time|sub("(?.*)\\.[\\d]{3}(?.*)"; "\(.time)Z")|fromdate) | .["title"] = .item.title | with_entries( select( .key as $k | $keys | index($k) ) )' <<< "$btsport_schedule")
+
+ if [ -n "$schedule" ]
+ then
+ schedule=$($JQ_FILE -s 'unique_by(.sys_time)' <<< "$schedule")
+ json=true
+ jq_path='["'"$chnl_id"'"]'
+ JQ update "$SCHEDULE_JSON" "$schedule"
+ Println "$info $chnl_name [$chnl_id] BT Sport 节目表更新成功"
+ else
+ Println "$error $chnl_name [$chnl_id] BT Sport 节目表更新失败"
+ fi
+ done
+}
+
+ScheduleBtsportOn()
+{
+ if [ ! -s "$SCHEDULE_JSON" ]
+ then
+ printf '{"%s":[]}' "btsport1" > "$SCHEDULE_JSON"
+ fi
+
+ btsport_schedule=$(curl -s -Lm 20 -H "User-Agent: $USER_AGENT_BROWSER" -H "referer: https://www.bt.com/sport/watch/whats-on" "https://www.bt.com/content/experience-fragments/bt/portal/sport/system_json/live_on_bt_sport/asset-exporter/master/jcr:content/root/asset_exporter.model.json")
+
+ for chnl in "${bton_chnls[@]}"
+ do
+ chnl_id=${chnl%%:*}
+ chnl_name="${chnl#*:}"
+
+ schedule=$($JQ_FILE --arg channel_name "$chnl_name" --argjson keys '["title","time","sys_time"]' '.liveEventsList[] | select(.channels[].name | contains($channel_name)) | .["time"] = (.startDate|sub("(?.*)\\.[\\d]{3}(?.*)"; "\(.time)Z")|fromdate|strflocaltime("%H:%M")) | .["sys_time"] = (.startDate|sub("(?.*)\\.[\\d]{3}(?.*)"; "\(.time)Z")|fromdate) | .["title"] = .competition + " - " + .title | with_entries( select( .key as $k | $keys | index($k) ) )' <<< "$btsport_schedule")
+
+ if [ -n "$schedule" ]
+ then
+ schedule=$($JQ_FILE -s 'unique_by(.sys_time)' <<< "$schedule")
+ json=true
+ jq_path='["'"$chnl_id"'"]'
+ JQ update "$SCHEDULE_JSON" "$schedule"
+ Println "$info $chnl_name [$chnl_id] BT Sport on 节目表更新成功"
+ else
+ Println "$error $chnl_name [$chnl_id] BT Sport on 节目表更新失败"
+ fi
+ done
+}
+
+SchedulePremierSports()
+{
+ if [ ! -s "$SCHEDULE_JSON" ]
+ then
+ printf '{"%s":[]}' "premiersports1" > "$SCHEDULE_JSON"
+ fi
+
+ printf -v today '%(%Y%m%d)T' -1
+ sys_time=$(date -d $today +%s)
+ yesterday=$(date --date="yesterday" +"%Y%m%d")
+ min_sys_time=$((sys_time-7200))
+ max_sys_time=$((sys_time+86400))
+
+ for chnl in "${pr_chnls[@]}"
+ do
+ chnl_id=${chnl%%:*}
+ pr_id="${chnl#*:}"
+ chnl_name="${pr_id#*:}"
+ pr_id=${pr_id%%:*}
+
+ schedule=()
+
+ pr_schedule=$(curl -s -Lm 20 -H "User-Agent: $USER_AGENT_BROWSER" "https://www.premiersports.com/system/get-tv-schedule?channel=$pr_id")
+ pr_schedule="${pr_schedule#*- (.+)\ ]]
+ then
+ schedule_title="${BASH_REMATCH[1]}"
+ fi
+
+ new_schedule="${new_schedule#*
(.+)\ ]]
+ then
+ if [ -n "$schedule_title" ]
+ then
+ schedule_title="$schedule_title - "
+ fi
+ schedule_title="$schedule_title${BASH_REMATCH[1]}"
+ fi
+
+ new_schedule=$(
+ $JQ_FILE -n --arg schedule_title "$schedule_title" --arg schedule_time "$schedule_time" --arg schedule_sys_time "$schedule_sys_time" \
+ '{
+ title: $schedule_title,
+ time: $schedule_time,
+ sys_time: $schedule_sys_time
+ }'
+ )
+
+ schedule+=("$new_schedule")
+ pr_schedule="${pr_schedule#* - "$SCHEDULE_JSON"
+ fi
+
+ printf -v today '%(%Y%m%d)T' -1
+ sys_time=$(date -d $today +%s)
+ yesterday=$(date --date="yesterday" +"%Y%m%d")
+ min_sys_time=$((sys_time-7200))
+ max_sys_time=$((sys_time+86400))
+
+ chnls_sid=""
+
+ for chnl in "${sk_chnls[@]}"
+ do
+ sk_sid="${chnl#*:}"
+ sk_sid="${sk_sid%%:*}"
+ [ -n "$chnls_sid" ] && chnls_sid="$chnls_sid,"
+ chnls_sid="$chnls_sid$sk_sid"
+ done
+
+ sk_yesterday_schedule=$(curl -s -Lm 20 -H "User-Agent: $USER_AGENT_BROWSER" "https://awk.epgsky.com/hawk/linear/schedule/$yesterday/$chnls_sid")
+ sk_today_schedule=$(curl -s -Lm 20 -H "User-Agent: $USER_AGENT_BROWSER" "https://awk.epgsky.com/hawk/linear/schedule/$today/$chnls_sid")
+
+ for chnl in "${sk_chnls[@]}"
+ do
+ chnl_id=${chnl%%:*}
+ sk_sid="${chnl#*:}"
+ chnl_name="${sk_sid#*:}"
+ sk_sid=${sk_sid%%:*}
+
+ schedule=""
+
+ yesterday_schedule=$($JQ_FILE --arg sid "$sk_sid" --arg min "$min_sys_time" --argjson keys '["title","time","sys_time"]' '.schedule[] | select(.sid == $sid).events[] | select((.st|tonumber) > ($min|tonumber)) | .["time"] = (.st|strflocaltime("%H:%M")) | .["sys_time"] = .st | .["title"] = .t | with_entries( select( .key as $k | $keys | index($k) ) )' <<< "$sk_yesterday_schedule")
+ today_schedule=$($JQ_FILE --arg sid "$sk_sid" --arg max "$max_sys_time" --argjson keys '["title","time","sys_time"]' '.schedule[] | select(.sid == $sid).events[] | select((.st|tonumber) < ($max|tonumber)) | .["time"] = (.st|strflocaltime("%H:%M")) | .["sys_time"] = .st | .["title"] = .t | with_entries( select( .key as $k | $keys | index($k) ) )' <<< "$sk_today_schedule")
+
+ schedule="${yesterday_schedule:-}${today_schedule:-}"
+
+ if [ -n "$schedule" ]
+ then
+ schedule=$($JQ_FILE -s 'unique_by(.sys_time)' <<< "$schedule")
+ json=true
+ jq_path='["'"$chnl_id"'"]'
+ JQ update "$SCHEDULE_JSON" "$schedule"
+ Println "$info $chnl_name [$chnl_id] Sky 节目表更新成功"
+ else
+ Println "$error $chnl_name [$chnl_id] Sky 节目表更新失败"
+ fi
+ done
+}
+
Schedule_4gtv()
{
printf -v today '%(%Y-%m-%d)T' -1
@@ -19279,6 +19754,107 @@ Schedule()
"astrosupersport4:241:Astro SuperSport 4 HD"
)
+ nbcsn_chnls=(
+ "nbcsn:NBCSN:NBCSN"
+ "nbcsnhd:NBCSNHD:NBCSN HD"
+ )
+
+ bs_chnls=(
+ "beinsports:1:beinsports"
+ "beinsportsar:2:beinsports AR"
+ "beinsports1:3:beinsports 1"
+ "beinsports2:4:beinsports 2"
+ "beinsports3:5:beinsports 3"
+ "beinsports4:6:beinsports 4"
+ "beinsports5:7:beinsports 5"
+ "beinsports6:8:beinsports 6"
+ "beinsports7:9:beinsports 7"
+ "beinsportspremium1:10:beinsports premium 1"
+ "beinsportspremium2:11:beinsports premium 2"
+ "beinsportspremium3:12:beinsports premium 3"
+ "beinsportsxtra1:13:beinsports xtra 1"
+ "beinsportsxtra2:14:beinsports xtra 2"
+ "beinsports4k:15:beinsports 4K"
+ "beinsportsnba:16:beinsports NBA"
+ "beinsportsenglish1:17:beinsports english 1"
+ "beinsportsenglish2:18:beinsports english 2"
+ "beinsportsenglish3:19:beinsports english 3"
+ "beinsportsfrench1:20:beinsports french 1"
+ "beinsportsfrench2:21:beinsports french 2"
+ "beinsportsfrench3:22:beinsports french 3"
+ )
+
+ bsau_chnls=(
+ "beinsports1au:BEINSP1:beinsports 1 AU"
+ "beinsports2au:BEINSP2:beinsports 2 AU"
+ "beinsports3au:BEINSP3:beinsports 3 AU"
+ )
+
+ su_chnls=(
+ "supersportpremierleague:SuperSport Premier League"
+ "supersportespn:ESPN"
+ "supersportespn2:ESPN2"
+ "supersportfootball:SuperSport Football"
+ "supersportpsl:SuperSport PSL"
+ "supersportcricket:SuperSport Cricket"
+ "supersportgrandstand:SuperSport Grandstand"
+ "supersportrugby:SuperSport Rugby"
+ "supersportgolf:SuperSport Golf"
+ "supersportaction:SuperSport Action"
+ "supersportblitz:SuperSport Blitz"
+ "supersportlaliga:SuperSport La Liga"
+ "supersportmotorsport:SuperSport Motorsport"
+ "supersportplay:SuperSport Play"
+ "supersportmaximo1:SuperSport MáXimo 1"
+ "supersporttennis:SuperSport Tennis"
+ "supersportginx:Ginx eSports TV"
+ "supersportwwe:WWE Channel"
+ "supersportcsn:Community Services Network"
+ "supersportvariety1:SuperSport Variety 1"
+ "supersportvariety2:SuperSport Variety 2"
+ "supersportvariety3:SuperSport Variety 3"
+ "supersportvariety4:SuperSport Variety 4"
+ )
+
+ bt_chnls=(
+ "btsportespn:BT Sport//ESPN"
+ "btsport1:BT Sport 1"
+ "btsport2:BT Sport 2"
+ "btsport3:BT Sport 3"
+ "btsportultimate:BT Sport Ultimate"
+ "boxnation:Box Nation"
+ )
+
+ bton_chnls=(
+ "btsportespn:BT Sport ESPN"
+ "btsport1:BT Sport 1"
+ "btsport2:BT Sport 2"
+ "btsport3:BT Sport 3"
+ "btsportextra1:BT Sport Extra 1"
+ "btsportextra2:BT Sport Extra 2"
+ "btsportextra3:BT Sport Extra 3"
+ "btsportextra4:BT Sport Extra 4"
+ "btsportultimate:BT Sport Ultimate"
+ "digitalexclusive:Digital Exclusive"
+ )
+
+ pr_chnls=(
+ "premiersports1:premiersports1:premier sports 1"
+ "premiersports2:premiersports2:premier sports 2"
+ "laLigatv:LaLiga:LaLiga TV"
+ "freesports:freesports:freesports"
+ "boxnation:Boxnation:Boxnation"
+ )
+
+ sk_chnls=(
+ "skysportspremierleague:1303:SkySp PL"
+ "skysportsmainevent:1301:SkySpMainEv"
+ "skysportsfootball:3838:SkySp F'ball"
+ "skysportscricket:1302:SkySp Cricket "
+ "premiersports1:5153:Premier 1 HD"
+ "premiersports2:1634:Premier 2 HD"
+ )
+
_4gtv_chnls=(
"minshidiyi:4gtv-4gtv003:民視第一台"
"minshitaiwan:4gtv-4gtv001:民視台灣台"
@@ -19434,6 +20010,13 @@ Schedule()
"cntv:cntv 节目表"
"tvbs:tvbs 节目表"
"astro:astro 节目表"
+ "nbcsn:nbcsn 节目表"
+ "bs:beinsports 节目表"
+ "bsau:beinsports AU 节目表"
+ "su:supersport 节目表"
+ "bt:BT Sport 节目表"
+ "pr:Premier Sports 节目表"
+ "sk:Sky 节目表"
"_4gtv:4gtv 节目表"
"other:其它节目表"
)
@@ -19511,6 +20094,27 @@ Schedule()
"astro")
ScheduleAstro
;;
+ "nbcsn")
+ ScheduleNbcsn
+ ;;
+ "bs")
+ ScheduleBeinsports
+ ;;
+ "bsau")
+ ScheduleBeinsportsAu
+ ;;
+ "su")
+ ScheduleSupersport
+ ;;
+ "bt")
+ ScheduleBtsport
+ ;;
+ "pr")
+ SchedulePremierSports
+ ;;
+ "sk")
+ ScheduleSky
+ ;;
"_4gtv")
Schedule_4gtv
;;
@@ -19646,7 +20250,7 @@ TsImg()
while IFS="=" read -r key value
do
token_array[$key]="$value"
- done < <(curl -s -Lm 10 -H "User-Agent: $user_agent" -X POST --data '{"role":"guest","deviceno":"'"$deviceno"'","deviceType":"yuj"}' "${ts_array[token_url]}" | $JQ_FILE -r 'to_entries | map("\(.key)=\(.value)") | .[]')
+ done < <(curl -s -Lm 10 -H "User-Agent: $user_agent" -H 'Content-Type: application/json' --data '{"role":"guest","deviceno":"'"$deviceno"'","deviceType":"yuj"}' "${ts_array[token_url]}" | $JQ_FILE -r 'to_entries | map("\(.key)=\(.value)") | .[]')
if [ "${token_array[ret]}" -eq 0 ]
then
@@ -19654,7 +20258,7 @@ TsImg()
while IFS="=" read -r key value
do
refresh_token_array[$key]="$value"
- done < <(curl -s -Lm 10 -H "User-Agent: $user_agent" -X POST --data '{"accessToken":"'"${token_array[accessToken]}"'","refreshToken":"'"${token_array[refreshToken]}"'"}' "${ts_array[refresh_token_url]}" | $JQ_FILE -r 'to_entries | map("\(.key)=\(.value)") | .[]')
+ done < <(curl -s -Lm 10 -H "User-Agent: $user_agent" -H 'Content-Type: application/json' --data '{"accessToken":"'"${token_array[accessToken]}"'","refreshToken":"'"${token_array[refreshToken]}"'"}' "${ts_array[refresh_token_url]}" | $JQ_FILE -r 'to_entries | map("\(.key)=\(.value)") | .[]')
if [ "${refresh_token_array[ret]}" -eq 0 ]
then
@@ -19684,7 +20288,7 @@ TsImg()
while IFS="=" read -r key value
do
token_array[$key]="$value"
- done < <(curl -s -Lm 10 -H "User-Agent: $user_agent" -X POST --data '{"usagescen":1}' "${ts_array[token_url]}" | $JQ_FILE -r 'to_entries | map("\(.key)=\(.value)") | .[]')
+ done < <(curl -s -Lm 10 -H "User-Agent: $user_agent" -H 'Content-Type: application/json' --data '{"usagescen":1}' "${ts_array[token_url]}" | $JQ_FILE -r 'to_entries | map("\(.key)=\(.value)") | .[]')
if [ "${token_array[ret]}" -eq 0 ]
then
@@ -19826,7 +20430,7 @@ TsRegister()
while IFS="=" read -r key value
do
reg_array[$key]="$value"
- done < <(curl -s -Lm 10 -H "User-Agent: $user_agent" -X POST --data '{"account":"'"$account"'","deviceno":"'"$deviceno"'","devicetype":"'"$devicetype"'","code":"'"${verify_array[code]}"'","signature":"'"$signature"'","birthday":"1970-1-1","username":"'"$account"'","type":1,"timestamp":"'"$timestamp"'","pwd":"'"$md5_password"'","accounttype":"'"${ts_array[acc_type_reg]}"'"}' "${ts_array[reg_url]}" | $JQ_FILE -r 'to_entries | map("\(.key)=\(.value)") | .[]')
+ done < <(curl -s -Lm 10 -H "User-Agent: $user_agent" -H 'Content-Type: application/json' --data '{"account":"'"$account"'","deviceno":"'"$deviceno"'","devicetype":"'"$devicetype"'","code":"'"${verify_array[code]}"'","signature":"'"$signature"'","birthday":"1970-1-1","username":"'"$account"'","type":1,"timestamp":"'"$timestamp"'","pwd":"'"$md5_password"'","accounttype":"'"${ts_array[acc_type_reg]}"'"}' "${ts_array[reg_url]}" | $JQ_FILE -r 'to_entries | map("\(.key)=\(.value)") | .[]')
if [ "${reg_array[ret]}" -eq 0 ]
then
@@ -19908,9 +20512,9 @@ TsLogin()
signature=${signature%% *}
if [[ ${ts_array[extend_info]} == "{"*"}" ]]
then
- token=$(curl -X POST -s --data '{"account":"'"$account"'","deviceno":"'"$deviceno"'","pwd":"'"$md5_password"'","devicetype":"yuj","businessplatform":1,"signature":"'"$signature"'","isforce":1,"extendinfo":'"${ts_array[extend_info]}"',"timestamp":"'"$timestamp"'","accounttype":'"${ts_array[acc_type_login]}"'}' "${ts_array[login_url]}")
+ token=$(curl -s -H 'Content-Type: application/json' --data '{"account":"'"$account"'","deviceno":"'"$deviceno"'","pwd":"'"$md5_password"'","devicetype":"yuj","businessplatform":1,"signature":"'"$signature"'","isforce":1,"extendinfo":'"${ts_array[extend_info]}"',"timestamp":"'"$timestamp"'","accounttype":'"${ts_array[acc_type_login]}"'}' "${ts_array[login_url]}")
else
- token=$(curl -X POST -s --data '{"account":"'"$account"'","deviceno":"'"$deviceno"'","pwd":"'"$md5_password"'","devicetype":"yuj","businessplatform":1,"signature":"'"$signature"'","isforce":1,"extendinfo":"'"${ts_array[extend_info]}"'","timestamp":"'"$timestamp"'","accounttype":'"${ts_array[acc_type_login]}"'}' "${ts_array[login_url]}")
+ token=$(curl -s -H 'Content-Type: application/json' --data '{"account":"'"$account"'","deviceno":"'"$deviceno"'","pwd":"'"$md5_password"'","devicetype":"yuj","businessplatform":1,"signature":"'"$signature"'","isforce":1,"extendinfo":"'"${ts_array[extend_info]}"'","timestamp":"'"$timestamp"'","accounttype":'"${ts_array[acc_type_login]}"'}' "${ts_array[login_url]}")
fi
fi
@@ -37213,8 +37817,8 @@ CloudflareListUser()
}"
IFS=$'\002\t' read -r cf_workers_requests error_message < <(
- JQs flat "$(curl -s -X POST -H ''"$curl_header_auth_email"'' -H ''"$curl_header_auth_key"'' -H ''"$curl_header_auth_token"'' \
- --data "$(echo $PAYLOAD)" -H 'Content-Type: application/json' https://api.cloudflare.com/client/v4/graphql)" '' \
+ JQs flat "$(curl -s -H 'Content-Type: application/json' -H ''"$curl_header_auth_email"'' -H ''"$curl_header_auth_key"'' -H ''"$curl_header_auth_token"'' \
+ --data "$(echo $PAYLOAD)" https://api.cloudflare.com/client/v4/graphql)" '' \
'[((.data|if (.|type == "string") then {} else . end).viewer.accounts.workersInvocationsAdaptive|if (.|type == "string") then {} else . end).sum.requests + "\u0002",
(.errors|if (.|type == "string") then {} else . end).message + "\u0002"]|@tsv' "{delimiters[@]}")
@@ -39811,7 +40415,7 @@ CloudflareConfigWorkerRoute()
Println "$info 输入路由,比如 abc.domain.com/*"
read -p "$i18n_default_cancel" pattern
[ -z "$pattern" ] && Println "$i18n_canceled...\n" && exit 1
- if [[ $(curl -s -X POST "https://api.cloudflare.com/client/v4/zones/$cf_users_zone_id/workers/routes" \
+ if [[ $(curl -s "https://api.cloudflare.com/client/v4/zones/$cf_users_zone_id/workers/routes" \
-H ''"$curl_header_auth_email"'' \
-H ''"$curl_header_auth_key"'' \
-H ''"$curl_header_auth_token"'' \
@@ -40168,7 +40772,7 @@ CloudflareWorkersMonitorUpdateRoutes()
Println "$info 路由修改成功\n"
else
fail_time=0
- until [[ $(curl -s -X POST "https://api.cloudflare.com/client/v4/zones/${zones_id[j]}/workers/routes" \
+ until [[ $(curl -s "https://api.cloudflare.com/client/v4/zones/${zones_id[j]}/workers/routes" \
-H ''"$curl_header_auth_email"'' \
-H ''"$curl_header_auth_key"'' \
-H ''"$curl_header_auth_token"'' \
@@ -40284,8 +40888,8 @@ CloudflareWorkersMonitorGetRequests()
}"
IFS=$'\002\t' read -r cf_workers_requests error_message < <(
- JQs flat "$(curl -s -X POST -H ''"$curl_header_auth_email"'' -H ''"$curl_header_auth_key"'' -H ''"$curl_header_auth_token"'' \
- --data "$(echo $PAYLOAD)" -H 'Content-Type: application/json' https://api.cloudflare.com/client/v4/graphql)" '' \
+ JQs flat "$(curl -s -H 'Content-Type: application/json' -H ''"$curl_header_auth_email"'' -H ''"$curl_header_auth_key"'' -H ''"$curl_header_auth_token"'' \
+ --data "$(echo $PAYLOAD)" https://api.cloudflare.com/client/v4/graphql)" '' \
'[((.data|if (.|type == "string") then {} else . end).viewer.accounts.workersInvocationsAdaptive|if (.|type == "string") then {} else . end).sum.requests + "\u0002",
(.errors|if (.|type == "string") then {} else . end).message + "\u0002"]|@tsv' "${delimiters[@]}")
@@ -47121,7 +47725,7 @@ method=ignore" > /etc/NetworkManager/system-connections/armbian.nmconnection
sed -i "0,/^listen_addresses = .*/s//listen_addresses = ['[::]:$listen_port']/" "$DNSCRYPT_ROOT/dnscrypt-proxy.toml"
systemctl restart dnscrypt-proxy
- if ! curl -s -X POST \
+ if ! curl -s -H 'Content-Type: application/json' \
--data '{"upstream_dns": ["127.0.0.1:'"$listen_port"'"], "ratelimit": 0}' "http://localhost:3000/control/dns_config"
then
Println "$error 请登陆 http://Armbian_IP:3000/ 手动修改上游 DNS 服务器为 127.0.0.1:$listen_port 并可以将速度限制设置为 0\n"
@@ -48325,7 +48929,7 @@ then
sed -i "0,/^listen_addresses = .*/s//listen_addresses = ['[::]:$listen_port']/" "$DNSCRYPT_ROOT/dnscrypt-proxy.toml"
systemctl restart dnscrypt-proxy
- if ! curl -s -X POST \
+ if ! curl -s -H 'Content-Type: application/json' \
--data '{"upstream_dns": ["127.0.0.1:'"$listen_port"'"], "ratelimit": 0}' "http://localhost:3000/control/dns_config"
then
Println "$error 请登陆 http://PVE_IP:3000/ 手动修改上游 DNS 服务器为 127.0.0.1:$listen_port 并可以将速度限制设置为 0\n"
@@ -48964,7 +49568,7 @@ then
for((try_i=0;try_i<10;try_i++));
do
- stream_link_data=$(curl -s -Lm 10 -X POST \
+ stream_link_data=$(curl -s -Lm 10 \
${_4gtv_proxy_command[@]+"${_4gtv_proxy_command[@]}"} \
-H "User-Agent: $user_agent" \
-H "${headers:0:-4}" \
|