forked from MPAndrew/EpgGratis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tv_grab_EpgGratis
executable file
·74 lines (62 loc) · 1.38 KB
/
tv_grab_EpgGratis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
XMLTV_TYPE="WEB"
XMLTV_LOCATION_FILE=""
XMLTV_LOCATION_WEB="https://github.com/MPAndrew/EpgGratis/raw/master/guide.xml.gz"
dflag=
vflag=
cflag=
if [ $# -lt 1 ]; then
if [ "$XMLTV_TYPE" = "FILE" ]; then
cat "$XMLTV_LOCATION_FILE"
exit 0
elif [ "$XMLTV_TYPE" = "WEB" ]; then
wget -qO - "$XMLTV_LOCATION_WEB" | zcat
exit 0
fi
fi
for arg
do
delim=""
case "$arg" in
#translate --gnu-long-options to -g (short options)
--description) args="${args}-d ";;
--version) args="${args}-v ";;
--capabilities) args="${args}-c ";;
--quiet) args="${args}-q ";;
#pass through anything else
*) [[ "${arg:0:1}" == "-" ]] || delim="\""
args="${args}${delim}${arg}${delim} ";;
esac
done
#Reset the positional parameters to the short options
eval set -- $args
while getopts "dvcq" option
do
case $option in
d) dflag=1;;
v) vflag=1;;
c) cflag=1;;
q) qflag=1;;
\?) printf "unknown option: -%s\n" $OPTARG
printf "Usage: %s: [--description] [--version] [--capabilities] \n" $(basename $0)
exit 2
;;
esac >&2
done
if [ "$dflag" ]
then
printf "tv_grab_EpgGratis - Movistar+, ServusTV, Sport1 y ZFDinfo"
fi
if [ "$vflag" ]
then
printf "0.2\n"
fi
if [ "$cflag" ]
then
printf "baseline\n"
fi
if [ "$qflag" ]
then
printf ""
fi
exit 0