Skip to content

Instantly share code, notes, and snippets.

@ray1980
Forked from aadps/dvr
Created December 21, 2021 00:15
Show Gist options
  • Save ray1980/ebc4c45255f6e7e1323659d43a45c0ba to your computer and use it in GitHub Desktop.
Save ray1980/ebc4c45255f6e7e1323659d43a45c0ba to your computer and use it in GitHub Desktop.
IPTV预约录像脚本
#!/bin/bash
m3u="/www/1.m3u"
dvrpath="/mnt/media/"
echo -n "频道名:"
read chan
while [ -z $(cat /www/1.m3u | grep ${chan} -A 1 | head -2 | tail -1) ]; do
echo -n "无此频道,请重新输入:"
read chan
done
echo -n "预约时间:"
read attime
echo -n "录制时长(默认1h):"
read duration
[ -z "$duration" ] && duration="1h"
echo -n "文件备注:"
read file
echo "timeout ${duration} wget $(cat ${m3u} | grep ${chan} -A 1 | head -2 | tail -1) --ignore-length -O ${dvrpath}\$(date +"%y%m%d")${file}.mp4" | at ${attime}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment