2013-11-15, 18:54
Somebody could give me a hand with this? I'm running an addon that isn't developed any more and I've got some problems with certain pvr timers that use days of the week instead of dates in yyyy-mm-dd format.
Part of the script that gets pvr timers and converts them:
Output of svdrpsend for a timer with days of the week and a "normal" one with a fixed date:
Complete script: http://pastebin.com/7CGFeDPy
I'm not experienced at all with python (or any coding for that matter), I can do some small changes by stealing bits of code here and there but changing this myself is above my skill set I think. I also do not know how much work this would be so any informations would be much appreciated.
Part of the script that gets pvr timers and converts them:
Code:
def _parseSVDRP(self, raw):
# empty result list
timers = {}
# loop thru lines
for line in raw.splitlines():
# as we know timers getting returned with status 250 (ok)
if line.startswith("250"):
try:
# get into the fields
fields = line[4:].split(":")
# check the timer status (flags 1: enabled, 2, instant record, 4, vps, 8: active)
timer_status = fields[0].split(" ")[1]
# decode starting time
timer_start = int(time.mktime(time.strptime(fields[2]+fields[3], "%Y-%m-%d%H%M")))
# fill the timer dictonary
if timer_start>0:
timers[timer_start] = int(timer_status)
except:
# some lines may fail
print "vdr.powersave: unable to parse line '%s' " % (line)
self._timers = timers
Output of svdrpsend for a timer with days of the week and a "normal" one with a fixed date:
Code:
250-1 1:137:M---F--:0550:0630:49:50:test:
250-2 1:2:2013-11-15:2210:2320:99:99:sportaktuell:
Complete script: http://pastebin.com/7CGFeDPy
I'm not experienced at all with python (or any coding for that matter), I can do some small changes by stealing bits of code here and there but changing this myself is above my skill set I think. I also do not know how much work this would be so any informations would be much appreciated.