Christians-iMac:Download_n_Merge_ts chunrix$ cat download_n_Merge_ts.sh
#!/bin/bash
#User Guide
#STEP1 check the TS file in INSPECT ELEMENT in Safari, confirm the URL of each TS file.
#STEP2 RUN this script, drag to generate the TS filename seq into NUMBERS.app.
#STEP3 Paste them into seq.txt and save.
#STEP4 Input the URL prefix according to the script prompt.
#STEP5 Script will list all URLs then download them.
#STEP6 Merge them automatically with script and export to the original folder.
#Define Variable
export_dir=$HOME/Desktop/Export_video
######STEP 1######
#Do it by yourself
echo 'Pls install WGET command first'
######STEP 2######
script_dir=$(cd "$(dirname "$0")";pwd)
echo $script_dir
cd "$script_dir"
open "/Applications/Numbers.app"
######STEP 3######
vi ./seq.txt
######STEP 4######
read -p 'Pls input the URL prefix: '
echo 'DO NOT INCLUDE the last SLASH'
######STEP 5######
for i in $(cat seq.txt)
do
echo http://file1.youflix.is/ZENa4FXMYK/1200kbps/$i.ts
echo "$REPLY"/$i.ts >> download.txt
echo "$REPLY"$i.ts >> download.txt
done
cat download.txt
mkdir -p $export_dir
wget -i download.txt -P $export_dir
######STEP 6######
open "$export_dir/"
echo
echo
echo 'Please use this command to merge your file:'
echo 'cat DRAGGED_ALL_FILES_HERE > $HOME/Desktop/Export_video/merged.ts'
rm download.txt
exit 1
Christians-iMac:Download_n_Merge_ts chunrix$ cat seq.txt
400
401