Please Help With Error
#1
19:19:14 T:3264 NOTICE: channelshow.php
19:19:16 T:14160 NOTICE: Thread FileCache start, auto delete: false
19:19:21 T:3264 NOTICE: Previous line repeats 8 times.
19:19:21 T:3264 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'urllib2.HTTPError'>
Error Contents: HTTP Error 508: Loop Detected
Traceback (most recent call last):
File "C:\Users\pipcan\AppData\Roaming\XBMC\addons\plugin.video.liveleak\default.py", line 102, in <module>
INDEX(url)
File "C:\Users\pipcan\AppData\Roaming\XBMC\addons\plugin.video.liveleak\default.py", line 20, in INDEX
response = urllib2.urlopen(req)
File "C:\Program Files (x86)\XBMC\system\python\Lib\urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "C:\Program Files (x86)\XBMC\system\python\Lib\urllib2.py", line 410, in open
response = meth(req, response)
File "C:\Program Files (x86)\XBMC\system\python\Lib\urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Program Files (x86)\XBMC\system\python\Lib\urllib2.py", line 448, in error
return self._call_chain(*args)
File "C:\Program Files (x86)\XBMC\system\python\Lib\urllib2.py", line 382, in _call_chain
result = func(*args)
File "C:\Program Files (x86)\XBMC\system\python\Lib\urllib2.py", line 531, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 508: Loop Detected
-->End of Python script error report<--
19:19:21 T:16128 ERROR: XFILE::CDirectory::GetDirectory - Error getting plugin://plugin.video.liveleak/?mode=1&name=Featured&url=channelshow.php
19:19:21 T:16128 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.liveleak/?mode=1&name=Featured&url=channelshow.php) failed
19:19:21 T:13300 NOTICE: Thread LanguageInvoker start, auto delete: false



I Fetch A Page channelsshow.php ad should list the channlels works with identical script different server


Here Is The working site. pointing at my working county script

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

# This Is Your Starter Script.
mysite "http://www.mykodi.co.uk/iptv2/admin/"
def CATEGORIES():
        
addDir('This Is A Test','browse',1,'IMAGE')
        
addDir('Featured','channelshow.php',1,'')
        
def INDEX(url):
    
url mysite 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="(.+?)"><img class="thumbnail_image" src="(.+?)" alt="(.+?)"').findall(link)
        for 
url,thumbnail,name in match:
      
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('file: "(.+?)",').findall(link)
      for 
url in match:
                
addLink(name,url,thumbnail,"")
                
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')
        
response urllib2.urlopen(req)
        
link=response.read()
        
response.close()
        
match=re.compile('file: "(.+?)",').findall(link)
        for 
url in match:
                
addLink(name,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,urlType):
        
ok=True
        liz
=xbmcgui.ListItem(nameiconImage="DefaultVideo.png"thumbnailImage=iconimage)
        
liz.setInfotype="Video"infoLabels={ "Title"name } )
        
liz.setProperty('IsPlayable','true')
    
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(nameiconImage="DefaultFolder.png"thumbnailImage=iconimage)
        
liz.setInfotype="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
        INDEX
(url)

xbmcplugin.endOfDirectory(int(sys.argv[1])) 
Reply
#2
judging from the error, you get a redirect loop. Did you try fetching the resulting URL with curl or wget?
Reply

Logout Mark Read Team Forum Stats Members Help
Please Help With Error0