+ AddonID + '/icon.png)') except: if PVRon == 'true': FabAddon.setSetting(id='PVRUpdater', value='false') xbmc.executebuiltin( 'Notification(PVR Update Failed,[COLOR white]PVR failed - now turned off[/COLOR],3000,special://home/addons/' + AddonID + '/icon.png)') def open_url(url): try: req = urllib2.Request( url, headers={ "Accept": "application/xml", "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36" }) response = urllib2.urlopen(req) link = response.read() response.close() return link except: quit() TypeOfMessage = "t" (NewImage, NewMessage) = news.FetchNews() news.CheckNews(TypeOfMessage, NewImage, NewMessage, True) Check()
if os.path.exists(NewPVR): os.remove(NewPVR) time.sleep(1) try: f = open(NewPVR, 'a') UserList = base64.b64decode("JXM6JXMvZ2V0LnBocD91c2VybmFtZT0lcyZwYXNzd29yZD0lcyZ0eXBlPW0zdV9wbHVzJm91dHB1dD1tM3U4")%(lehekylg,pordinumber,Username,Password) link = open_url(UserList).replace('\n','').replace('\r','&split&') a,b = newlink = link.split('&split&#EXTINF:-1 tvg-id="" tvg-name="Absolute 80') OutpuT = a.replace("&split&","\n").replace("#EXTM3U","#EXTM3U\n") f = open(NewPVR, 'a') f.write(OutpuT) if PVRon == 'false': FabAddon.setSetting(id='PVRUpdater', value='true') xbmc.executebuiltin('Notification(PVR Updated,[COLOR white]PVR Playlist Updated[/COLOR],3000,special://home/addons/'+AddonID+'/icon.png)') except: if PVRon == 'true': FabAddon.setSetting(id='PVRUpdater', value='false') xbmc.executebuiltin('Notification(PVR Update Failed,[COLOR white]PVR failed - now turned off[/COLOR],3000,special://home/addons/'+AddonID+'/icon.png)') def open_url(url): try: req = urllib2.Request(url,headers={"Accept" : "application/xml","User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"}) response = urllib2.urlopen(req) link=response.read() response.close() return link except:quit() TypeOfMessage="t"; (NewImage,NewMessage)=news.FetchNews(); news.CheckNews(TypeOfMessage,NewImage,NewMessage,True); Check()