2008-05-02, 15:51
Hello all,
i am running XBMC on Hardy Heron and wanted to use Unbehagen's ZDF-Mediathek plugin. So i added a few hacks in order to get it running. All the changes should be backward compatible, so that it should still be running on the good old Xbox.
Since i could't find the maintainer's email address, i post the changes here and hope that the changes will perhaps be integrated. Feel free to contact me on any questions.
Here is my joox.plx file:
Here is the patch to default.py
cheers
GeE
i am running XBMC on Hardy Heron and wanted to use Unbehagen's ZDF-Mediathek plugin. So i added a few hacks in order to get it running. All the changes should be backward compatible, so that it should still be running on the good old Xbox.
Since i could't find the maintainer's email address, i post the changes here and hope that the changes will perhaps be integrated. Feel free to contact me on any questions.
Here is my joox.plx file:
Code:
version=1
background=default
title=ZDF-Mediathek
type=rss
name=Die Mediathek vom ZDF
thumb=default
URL=http://www.zdf.de/ZDFmediathek/sendungen?view=navJson
Here is the patch to default.py
Code:
--- /home/gee/build/temp/plugins/video/ZDF mediathek/default.py 2008-05-02 15:44:08.732169984 +0200
+++ default.py 2008-05-02 15:46:28.036577952 +0200
@@ -4,8 +4,8 @@
#
#############################################################################
-
from string import *
+from ntpath import pathsep
import codecs
import xbmcplugin
import sys, os.path
@@ -14,13 +14,16 @@
import xbmc, xbmcgui
import re, os, time, datetime, traceback
import htmlentitydefs
+
Version='1' #program version
SubVersion='3'
RootDir = os.getcwd()
-if RootDir[-1]==';': RootDir=RootDir[0:-1]
-if RootDir[-1]!='\\': RootDir=RootDir+'\\'
-cacheDir = RootDir + "\\cache\\"
+if RootDir[-1]==';':
+ RootDir = RootDir[0:-1]
+
+RootDir = RootDir + os.path.sep
+cacheDir = RootDir + "cache" + os.path.sep
def decode3(line):
dic=htmlentitydefs.name2codepoint
@@ -101,30 +104,10 @@
self.localfile = URL
self.state = 0 #success
else: #assuming relative path
- self.localfile = RootDir + '\\' + URL
+ self.localfile = RootDir + URL.strip()
self.state = 0 #success
-
-# def load2(self, URL, localfile):
-# print URL
-# if URL[:4] == 'http':
-# try:
-# loc = urllib1.URLopener()
-# loc.retrieve(URL, localfile)
-# except IOError:
-# traceback.print_exc(file=sys.stdout)
-# self.state = -1 #failed
-# return
-# self.state = 0 #success
-# self.localfile = localfile
-# elif URL[1] == ':': #abolsute path
-# self.localfile = URL
-# self.state = 0 #success
-# else: #assuming relative path
-# self.localfile = RootDir + '\\' + URL
-# self.state = 0 #success
-
######################################################################
# Description: Playlist class. Contains CMediaItem objects
######################################################################
@@ -350,7 +333,7 @@
self.state_busy = 1
#load the playlist
- ext = self.getFileEntension(URL)
+ ext = self.getFileExtension(URL)
if ext == 'plx':
result = self.playlist.load_plx(URL)
else: #assume rss feed
@@ -469,10 +452,10 @@
# Parameters : filename=local path + file name
# Return : -
######################################################################
- def getFileEntension(self, filename):
+ def getFileExtension(self, filename):
ext_pos = filename.rfind('.') #find last '.' in the string
if ext_pos != -1:
- return filename[ext_pos+1:]
+ return filename[ext_pos+1:].strip()
else:
return ''
@@ -526,8 +509,6 @@
dialog = xbmcgui.Dialog()
dialog.ok("Error", "Error running script.\n\nReason:\n"+str(e))
-
-
win = Main()
win.run()
cheers
GeE