Skip to content

Instantly share code, notes, and snippets.

@aadps
Last active February 24, 2023 07:06
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aadps/3729f610cb0d8b8543ce637b6eb1f28c to your computer and use it in GitHub Desktop.
Save aadps/3729f610cb0d8b8543ce637b6eb1f28c 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