Kodi Community Forum

Full Version: Ignore one link without affecting the other
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[sintaxe = python] try:              
         link = common.OpenURL (url) .replace ('\ n', '') 
          m = re.compile ("globalUri = '([^ \'] +) '")). findall(link) 
          m2 = re.compile ("globalUri2 = '([^ \'] +) '")). findall(link) 
          para url2 em [m, m2]: 
              AddDir (nome, url2, 10, iconimage, iconimage, isFolder = False, IsPlayable = True, info = "", fundo = url) 
    except IndexError:      
           pass
[/ sintaxe] 

error log:                                                 

m2 = re.compile ( "globalUri2 = '([^ \' ] +) '"). findall (link)                                            
IndexError: list index out of range




It turns out that the "m2" sometimes does not exist in the imported url but the "m" always exists, so I would like to ignore only the "m2" when it is not found, Help