def sport356Thread2(url, header): import re, sport365 as s xbmc.log("sport356Thread2 url: %s" % url, level=xbmc.LOGNOTICE) player = xbmc.Player() xbmc.sleep(2000) #3minutes player.pause() while player.isPlaying(): ########################## #print 'sport356Thread: KODI IS PLAYING, sleeping ...' # try: xbmc.log("sport356Thread: KODI IS PLAYING, sleeping ...", level=xbmc.LOGNOTICE) a, c = s.getUrlc(url, header=header, usecookies=True) if not a: break xbmc.log(a, level=xbmc.LOGNOTICE) banner = re.compile('url\s*:\s*["\'](.*?)[\'"]').findall(a)[0] xbmc.log(banner, level=xbmc.LOGNOTICE) xbmc.sleep(2000) s.getUrlc(banner) xbmc.sleep(2000) # except BaseException: # pass # data, c = s.getUrlc(banner) # banner = re.findall(r'window.location.replace\("([^"]+)"\);\s*}\)<\/script><div', data)[0] # s.getUrlc(urllib.quote(banner, ':/()!@#$%^&;><?')) # xbmc.sleep(20000) #print 'sport356Thread: KODI STOPED, OUTSIDE WHILE LOOP ... EXITING' xbmc.log("sport356Thread: KODI STOPED, OUTSIDE WHILE LOOP ... EXITING", level=xbmc.LOGNOTICE)
def sport356Thread2(url, header): import re, sport365 as s player = xbmc.Player() xbmc.sleep(2000) #3minutes player.pause() while player.isPlaying(): ########################## print 'sport356Thread: KODI IS PLAYING, sleeping 4s' a, c = s.getUrlc(url, header=header, usecookies=True) banner = re.compile('url:["\'](.*?)[\'"]').findall(a)[0] xbmc.log(banner) xbmc.sleep(2000) s.getUrlc(banner) xbmc.sleep(2000) print 'sport356Thread: KODI STOPED, OUTSIDE WHILE LOOP ... EXITING'
def sport356Thread2(url, header): import re, sport365 as s player = xbmc.Player() xbmc.sleep(20000) #3minutes player.pause() while player.isPlaying(): ########################## print 'sport356Thread: KODI IS PLAYING, sleeping ...' a, c = s.getUrlc(url, header=header, usecookies=True) banner = re.compile('url:["\'](.*?)[\'"]').findall(a)[0] xbmc.log(banner) xbmc.sleep(20000) data, c = s.getUrlc(banner) banner = re.findall(r'window.location.replace\("([^"]+)"\);\s*}\)<\/script><div', data)[0] s.getUrlc(urllib.quote(banner, ':/()!@#$%^&;><?')) xbmc.sleep(20000) print 'sport356Thread: KODI STOPED, OUTSIDE WHILE LOOP ... EXITING'
def sport356Thread2(url,header): import sport365 as s import re player = xbmc.Player() xbmc.sleep(2000) # speep print 'sport356Thread: passed url: [%s] '%url #print header player.pause() while player.isPlaying(): print 'sport356Thread: KODI IS PLAYING, sleeping 4s' a,c=s.getUrlc(url,header=header,useCookies=True) banner = re.compile('url:["\'](.*?)[\'"]').findall(a)[0] xbmc.log(banner) xbmc.sleep(2000) s.getUrlc(banner) xbmc.sleep(2000) print 'sport356Thread: KODI STOPED, OUTSIDE WHILE LOOP ... EXITING'