MovieMaze Trailer Plugin - need Help pls
#1
Hello people, I'm new in this forum.

I have read the tutorial of Voinage and had success.
Unfortunately I have problems with the site http://www.moviemaze.de.

The video starts not in xbmc.
Can someone please give me tips where the error is?

Here is the Code:

Code:
import urllib,urllib2,re,xbmcplugin,xbmcgui

#MovieMaze - by You 2010.

def CATEGORIES():
        addDir('Aktuelle Trailer','http://www.moviemaze.de/media/trailer/',1,'http://www4.mm-static.de/header/grafiken/logo.gif')
#Mode 1                      
def INDEX1(url):
        req = urllib2.Request(url)
        req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
        response = urllib2.urlopen(req)
        link=response.read()
        response.close()
        match=re.compile('<a href="(.+?)">(.+?)</a></td></tr><tr>').findall(link)
        for url,name in match:
                addDir(name,'http://www.moviemaze.de'+url,2,'')
#Mode 2
def INDEX2(url):
        req = urllib2.Request(url)
        req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
        response = urllib2.urlopen(req)
        link=response.read()
        response.close()
        match=re.compile('<td class="bggrey" style=".+?">.+?</td><td class=".+?" style="text-align:center"><a href="(.+?-de_.+?.mov)" target="_blank"').findall(link)
        for url in match:
                addDir(name,'http://www.moviemaze.de'+url,3,'')        
#Mode 3
def VIDEOLINKS(url,name):
        req = urllib2.Request(url)
        #req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
        req.add_header('User-Agent', 'QuickTime/7.6.2 (qtver=7.6.2;os=Windows NT 5.1Service Pack 3)')
        response = urllib2.urlopen(req)
        link=response.read()
        response.close()
        match=re.compile('SRC="(.+?)"').findall(link)
    name = 'Play'
        for url in match:
                addLink(name,'http://www.moviemaze.de'+url,'')
        

                
def get_params():
        param=[]
        paramstring=sys.argv[2]
        if len(paramstring)>=2:
                params=sys.argv[2]
                cleanedparams=params.replace('?','')
                if (params[len(params)-1]=='/'):
                        params=params[0:len(params)-2]
                pairsofparams=cleanedparams.split('&')
                param={}
                for i in range(len(pairsofparams)):
                        splitparams={}
                        splitparams=pairsofparams[i].split('=')
                        if (len(splitparams))==2:
                                param[splitparams[0]]=splitparams[1]
                                
        return param




def addLink(name,url,iconimage):
        ok=True
        liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
        liz.setInfo( type="Video", infoLabels={ "Title": name } )
        ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
        return ok


def addDir(name,url,mode,iconimage):
        u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
        ok=True
        liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
        liz.setInfo( type="Video", infoLabels={ "Title": name } )
        ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
        return ok
        
              
params=get_params()
url=None
name=None
mode=None

try:
        url=urllib.unquote_plus(params["url"])
except:
        pass
try:
        name=urllib.unquote_plus(params["name"])
except:
        pass
try:
        mode=int(params["mode"])
except:
        pass

print "Mode: "+str(mode)
print "URL: "+str(url)
print "Name: "+str(name)

if mode==None or url==None or len(url)<1:
        print ""
        CATEGORIES()
      
elif mode==1:
        print ""+url
        INDEX1(url)

elif mode==2:
        print ""+url
        INDEX2(url)
        
elif mode==3:
        print ""+url
        VIDEOLINKS(url,name)

xbmcplugin.endOfDirectory(int(sys.argv[1]))
Reply

Logout Mark Read Team Forum Stats Members Help
MovieMaze Trailer Plugin - need Help pls0