The online cache stream often causes data synchronization to be incomplete due to network problems, requires manual download, and is now scripted to complete the download, but requires passing in three parameters: Channel name, start time, end time.
#!/bin/bash# incoming parameter read -p "Please input english channel name:" channelread -p "Please input starttime: ' 1970-01-01 00:00:00 ' " starttimeread -p "Please input endtime: ' 1970-01-01 00:00:00 ' " endtime# Convert time Variables starttime= ' date --date= ' $Starttime ' +%s ' endtime= ' date --date= ' $Endtime ' +%s ' echo $channel, $starttime, $endtimeYear = ' date --date= ' $Starttime " +%y ' month= ' date --date=" $ Starttime " +%m ' date= ' date --date=" $Starttime " +%d ' basicdir=/opt/online01/streamcodetype= 2500000links -dump "Http://xxxx.live.tvmining.com/approve/vod?type=ipsd&channel= $channel &starttime= $starttime &endtime= $endtime " | grep http > stream.m3u8for file in ' cat stream.m3u8 ' do localfile= $basicDir/' echo $file | awk -F stream/ ' { print $2} ' if [ -e $localfile ];then echo $localfile already exists else if [ -e $basicDir/$codetype/$channel/$ year/$Month/$Date ];then wget $file -p $basicDir/$codetype/$channel/$Year/$Month/$Date &> /dev/null && echo "$file down sucessfully" else echo $basicDir/$codetype/$channel/$Year /$Month/$Date not exists && exit 12 fi fi done
Only as a self-learning parameter
This article from "Eagle" blog, declined reprint!
Data Flow Completion Script