Hey everyone!
Danke für die neue version, sfaxman!
I have yet another idea for improvement.
ZDF-Mediathek on XBMC is great. There is one annoying thing though:
When i want to watch the newest episode of a specific show, its hard to find out which item is the most recent, because
right now the videos are not sorted by date.
So why not use the power of XBMC by
specifing a video-date. This is possible via the listitem.setInfo command:
Code:
listitem.setInfo("video", {"Title":titlevariable, "Date": datevariable})
Now the videos can be sorted by date.
I dont know exactly what date format is expected (a documentation about the plugin api is still missing).
From a quick look at the code of Apple Movie Trailer Plugin, its probably YEAR-MONTH-DAY format.
The date for the ZDF video can be extracted with regex from the json "assetUrl" tag which is e.g.
....zdf.de/zdf/veryhigh/080714_leinhos_hjo.asx
The date of this video is 2008-07-14.
As i am neither good at regex nor python here are just some code snippets to help sfaxman to include this idea in an upcoming release:
in file zdf.de.cfg:
Code:
video_date=assetUrl\":%SOME REGEX EXPRESSION%
in file default.py:
line 775
Code:
# datecatcher = regex from assetUrl so it will read 080714
# postdate = rewrite 080714 to 2008-07-14 which is the format xbmc listitem.setinfo expects
if (video_date != ''):
try:
date_catcher = video_date % (url)
except:
date_catcher = video_date
redate = re.compile(date_catcher, re.IGNORECASE + re.DOTALL + re.MULTILINE)
postdate = 20+"%s-%s-%s" % ( redate[ : 2 ], redate[ 3 : 4 ], redate[ 5 : ], )
datesearch = postdate.search(data)
try:
date = datesearch.group(1)
except:
traceback.print_exc(file = sys.stdout)
date = '0000-00-00'
tmp.date = date.lstrip().rstrip()
if (len(tmp.date) == 0):
tmp.date = '0000-00-00'
line 945
Code:
# add date information of video via setinfo only if date is set ; else only set title
if self.date != '':
listitem.setInfo("video", {"Title":title, "Date": date})
else:
listitem.setInfo("video", {"Title":title})
line 1110
Code:
# add sort method "date" to directory only if date is set
if self.date != '':
xbmcplugin.addSortMethod(handle = self.handle, sortMethod = xbmcplugin.SORT_METHOD_DATE)
Have a nice day!