From 47b1b00468204a4fbe3580e875e5b25cf2a2d074 Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Fri, 24 Sep 2021 17:39:58 +0800 Subject: [PATCH] feat: add m3u8 download script --- m3u8下載/dl.sh | 11 ++++++++--- m3u8下載/test.sh | 6 ++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/m3u8下載/dl.sh b/m3u8下載/dl.sh index 54f7336..f126a4b 100644 --- a/m3u8下載/dl.sh +++ b/m3u8下載/dl.sh @@ -51,10 +51,15 @@ echo file: $file while read p; do if [[ $p != "#"* ]]; then pp=$(echo $p | sed 's/[\*\.\&\?]/\\&/g') - ts="$(echo $BASE | sed "s,$file,$pp,") -o $p" - - eval " $ts" + ts="$(echo $BASE | sed "s,$file,$pp,") -o $p -w '%{http_code}'" + status_code=$(eval " $ts") + if [ $status_code != "200" ]; then + echo + echo ERROR: $status_code, 下載失敗. + cat $p + exit 1 + fi fi done