share/Scripts/m3u8-download/test.sh

46 lines
1.5 KiB
Bash
Raw Permalink Normal View History

2021-09-24 09:35:46 +00:00
BASE="curl 'https://vod.live.eplus.jp/out/v1/f69369f0004d4e30a93381c0f9cf5c5c/76b6cf49f18ca1445cbd28b3f950733e/index_4_3847.ts' \
2021-09-24 09:13:42 +00:00
-H 'authority: vod.live.eplus.jp' \
-H 'pragma: no-cache' \
-H 'cache-control: no-cache' \
-H 'sec-ch-ua: \"Google Chrome\";v=\"93\", \" Not;A Brand\";v=\"99\", \"Chromium\";v=\"93\"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36' \
-H 'sec-ch-ua-platform: "Windows"' \
-H 'accept: */*' \
-H 'origin: https://live.eplus.jp' \
-H 'sec-fetch-site: same-site' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-dest: empty' \
-H 'referer: https://live.eplus.jp/' \
-H 'accept-language: zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7,ja;q=0.6' \
-H 'cookie: CloudFront-Key-Pair-Id=XXX; CloudFront-Policy=XXX; CloudFront-Signature=XXX%XXX-XX-XX__; KOJIN_SHIKIBETSU=1234; MEMBER_ID=1234; TODOFUKEN_CODE=13; _ga=GA1.2.00.00; _gid=GA1.2.000.00; _gat_UA-44492173-17=1; _gat_gtag_UA_44492173_17=1' \
--compressed"
2021-09-24 09:35:46 +00:00
origin=$(echo $BASE | sed -e "s/[^']*'\([^\?^']*\).*'.*/\1/" )
2021-09-24 09:13:42 +00:00
file=${origin##*/}
file=$(echo $file | sed 's/[\*\.\&\?]/\\&/g')
p=test.ts
pp=$(echo $p | sed 's/[\*\.\&\?]/\\&/g')
2021-09-24 09:35:46 +00:00
ts="$(echo $BASE | sed "s,$file,$pp,") -o $p -w '%{http_code}'"
2021-09-24 09:13:42 +00:00
2021-09-24 09:35:46 +00:00
echo base: $BASE
2021-09-24 09:13:42 +00:00
echo
echo origin: $origin
echo
echo file: $file
echo
2021-09-24 09:35:46 +00:00
echo command: $ts
status_code=$(eval " $ts")
echo
echo status_code: $status_code
2021-09-24 09:39:58 +00:00
if [ $status_code != "200" ]; then
echo ERROR: $status_code, 下載失敗.
cat $p
exit 1
fi
2021-09-24 09:35:46 +00:00