#from 1-99 functions related to the addon menu functions if mode == None: print("Installed version: v" + versao) if settings.getSetting('autoconfig') == "true": first_conf() else: if settings.getSetting('last_version_check') != versao: try: check_for_updates() except: pass if settings.getSetting('enter_channel_list') == "false": main_menu() else: parsers.addon_parsers_menu() elif mode == 1: ace.acestreams(name, iconimage, url) elif mode == 2: sop.sopstreams(name, iconimage, url) elif mode == 3: go_to_id('sop_id') elif mode == 4: go_to_id('ace') elif mode == 5: go_to_id('sop_url') elif mode == 6: ace.load_local_torrent() elif mode == 7: stop_aceengine() elif mode == 8: list_history() elif mode == 9:
except: pass print("Mode: "+str(mode)) print("URL: "+str(url)) print("Name: "+str(name)) print("Iconimage: "+str(iconimage)) print("Parser: "+str(parser)) print("Parserfunction: "+str(parserfunction)) #from 1-99 functions related to the addon menu functions if mode==None or url==None or len(url)<1: print("Installed version: v" + versao) if settings.getSetting('autoconfig') == "true": autoconf() main_menu() elif mode==1: ace.acestreams(name,iconimage,url) elif mode==2: sop.sopstreams(name,iconimage,url) elif mode==3: go_to_id('sop_id') elif mode==4: go_to_id('ace') elif mode==5: go_to_id('sop_url') elif mode==6: ace.load_local_torrent() #from 100-199 functions related to xml lists elif mode==100: xml_lists_menu() elif mode==101: list_type(url) elif mode==102: get_channels(name,url) elif mode==103: getChannelItems(name,url,"fanart") elif mode==104: getRegexParsed(regexs, url) elif mode==105: item = xbmcgui.ListItem(path=url); xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item) elif mode==106: xbmc.executebuiltin(url.replace(';','')) elif mode==107: addlista() elif mode==108: remove_list(name)
print("Parser: "+str(parser)) print("Parserfunction: "+str(parserfunction)) #from 1-99 functions related to the addon menu functions if mode==None: print("Installed version: v" + versao) if settings.getSetting('autoconfig') == "true": first_conf() else: if settings.getSetting('last_version_check') != versao: try:check_for_updates() except: pass if settings.getSetting('enter_channel_list') == "false": main_menu() else: parsers.addon_parsers_menu() elif mode==1: ace.acestreams(name,iconimage,url) elif mode==2: sop.sopstreams(name,iconimage,url) elif mode==3: go_to_id('sop_id') elif mode==4: go_to_id('ace') elif mode==5: go_to_id('sop_url') elif mode==6: ace.load_local_torrent() elif mode==7: stop_aceengine() elif mode==8: list_history() elif mode==9: remove_history() #from 100-199 functions related to xml lists elif mode==100: xml_lists_menu() elif mode==101: list_type(url) elif mode==102: get_channels(name,url) elif mode==103: getChannelItems(name,url,"fanart") elif mode==104: getRegexParsed(regexs, url) elif mode==105: item = xbmcgui.ListItem(path=url); xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, item)
print("Parserfunction: " + str(parserfunction)) # from 1-99 functions related to the addon menu functions if mode == None or url == None or len(url) < 1: print("Installed version: v" + versao) if settings.getSetting("autoconfig") == "true": first_conf() else: if settings.getSetting("last_version_check") != versao: try: check_for_updates() except: pass main_menu() elif mode == 1: ace.acestreams(name, iconimage, url) elif mode == 2: sop.sopstreams(name, iconimage, url) elif mode == 3: go_to_id("sop_id") elif mode == 4: go_to_id("ace") elif mode == 5: go_to_id("sop_url") elif mode == 6: ace.load_local_torrent() # from 100-199 functions related to xml lists elif mode == 100: xml_lists_menu() elif mode == 101: list_type(url)
def do_GET(self): host = self.headers.get('Host') global link global currentpvr global currentace global curmode global linkarray global isplay if self.path == '/': self.send_response(200) self.send_header('Content-type', 'text/html') self.end_headers() self.wfile.write('P2P service is running !') #self.wfile.close(); self.finish() elif "p2p.m3u?" in self.path: args = parse_qs(urlparse(self.path).query); url = args['url'][0]; mode = args['mode'][0]; EXTM3U = '#EXTM3U\n'; if url == currentace and currentpvr and link: isplay = True EXTM3U += '#EXT-X-VERSION:3\n' EXTM3U += '#EXT-X-ALLOW-CACHE:NO\n' EXTM3U += '#EXT-X-TARGETDURATION:16\n' EXTM3U += '#EXT-X-MEDIA-SEQUENCE:817\n' EXTM3U += '#EXTINF:10.0,\n' EXTM3U += link +'\n'; EXTM3U += '#EXTINF:10.0,\n' EXTM3U += link +'\n'; EXTM3U += '#EXTINF:10.0,\n' EXTM3U += link +'\n\n'; self.send_response(200) self.send_header('Content-type', 'application/x-mpegURL') self.send_header('Connection', 'close') self.send_header('Content-Length', len(EXTM3U)) self.end_headers() self.wfile.write(EXTM3U.encode('utf-8')) self.wfile.close() self.finish() else: EXTM3U += '#EXTINF:-1, dummy\n' EXTM3U += 'blank.mp4\n\n'; self.send_response(200) self.send_header('Content-type', 'application/x-mpegURL') self.send_header('Connection', 'close') self.send_header('Content-Length', len(EXTM3U)) self.end_headers() self.wfile.write(EXTM3U.encode('utf-8')) self.wfile.close() self.finish() try: currentpvr = xbmc.Player().getPlayingFile() xbmc.Player().stop() except: sys.stdout.write('error while stopping play') if isplay: sys.stdout.write('playing something already, try to stop p2p engine') if curmode == '1': TSPlayer = tsengine() TSPlayer.end() elif curmode == '2': try:sop.killme(linkarray[1]) except:sys.stdout.write('Could not stop sopcast !') currentace = False link = False linkarray = False alive = 'none' curmode = '0' xbmc.sleep(1000); isplay = False currentace = url if mode == '1': curmode = mode link = ace.acestreams('p2pPlay',None,url,True) sys.stdout.write('Done get link : %s (%s) (%s)' % (link,currentace,currentpvr)) elif mode == '2': curmode = mode linkarray = sop.sopstreams('p2pPlay',None,url,True) try: link = linkarray[0] sys.stdout.write('Done get link : %s (%s) (%s)' % (link,currentace,currentpvr)) except:sys.stdout.write('Sopcast Failed !') if link and len(link) > 5: xbmc.sleep(500) xbmc.executebuiltin("PlayMedia("+currentpvr+")") if isplay: xbmc.sleep(2000) while xbmc.Player().isPlaying() and currentpvr == xbmc.Player().getPlayingFile():xbmc.sleep(2000) switchChannel = False xbmc.sleep(1000) try: if 'pvr.iptvsimple' in xbmc.Player().getPlayingFile():switchChannel = True except:sys.stdout.write('no channel playing start kill !') if not switchChannel: if curmode == '1': TSPlayer = tsengine() TSPlayer.end() elif curmode == '2': try:sop.killme(linkarray[1]) except:sys.stdout.write('Could not stop sopcast !') currentace = False currentpvr = False linkarray = False link = False curmode = '0' isplay = False elif self.path == '/stop': if curmode == '1': TSPlayer = tsengine() TSPlayer.end() elif curmode == '2': try:sop.killme(linkarray[1]) except:sys.stdout.write('Could not stop sopcast !') else: self.send_response(404) self.send_header('Content-type','text/html') self.end_headers() self.wfile.write("404") self.wfile.close();
def do_GET(self): host = self.headers.get('Host') global link global currentpvr global currentace global curmode global linkarray global isplay if self.path == '/': self.send_response(200) self.send_header('Content-type', 'text/html') self.end_headers() self.wfile.write('P2P service is running !') #self.wfile.close(); self.finish() elif "p2p.m3u?" in self.path: args = parse_qs(urlparse(self.path).query) url = args['url'][0] mode = args['mode'][0] EXTM3U = '#EXTM3U\n' if url == currentace and currentpvr and link: isplay = True EXTM3U += '#EXT-X-VERSION:3\n' EXTM3U += '#EXT-X-ALLOW-CACHE:NO\n' EXTM3U += '#EXT-X-TARGETDURATION:16\n' EXTM3U += '#EXT-X-MEDIA-SEQUENCE:817\n' EXTM3U += '#EXTINF:10.0,\n' EXTM3U += link + '\n' EXTM3U += '#EXTINF:10.0,\n' EXTM3U += link + '\n' EXTM3U += '#EXTINF:10.0,\n' EXTM3U += link + '\n\n' self.send_response(200) self.send_header('Content-type', 'application/x-mpegURL') self.send_header('Connection', 'close') self.send_header('Content-Length', len(EXTM3U)) self.end_headers() self.wfile.write(EXTM3U.encode('utf-8')) self.wfile.close() self.finish() else: EXTM3U += '#EXTINF:-1, dummy\n' EXTM3U += 'blank.mp4\n\n' self.send_response(200) self.send_header('Content-type', 'application/x-mpegURL') self.send_header('Connection', 'close') self.send_header('Content-Length', len(EXTM3U)) self.end_headers() self.wfile.write(EXTM3U.encode('utf-8')) self.wfile.close() self.finish() try: currentpvr = xbmc.Player().getPlayingFile() xbmc.Player().stop() except: sys.stdout.write('error while stopping play') if isplay: sys.stdout.write( 'playing something already, try to stop p2p engine') if curmode == '1': TSPlayer = tsengine() TSPlayer.end() elif curmode == '2': try: sop.killme(linkarray[1]) except: sys.stdout.write('Could not stop sopcast !') currentace = False link = False linkarray = False alive = 'none' curmode = '0' xbmc.sleep(1000) isplay = False currentace = url if mode == '1': curmode = mode link = ace.acestreams('p2pPlay', None, url, True) sys.stdout.write('Done get link : %s (%s) (%s)' % (link, currentace, currentpvr)) elif mode == '2': curmode = mode linkarray = sop.sopstreams('p2pPlay', None, url, True) try: link = linkarray[0] sys.stdout.write('Done get link : %s (%s) (%s)' % (link, currentace, currentpvr)) except: sys.stdout.write('Sopcast Failed !') if link and len(link) > 5: xbmc.sleep(500) xbmc.executebuiltin("PlayMedia(" + currentpvr + ")") if isplay: xbmc.sleep(2000) while xbmc.Player().isPlaying() and currentpvr == xbmc.Player( ).getPlayingFile(): xbmc.sleep(2000) switchChannel = False xbmc.sleep(1000) try: if 'pvr.iptvsimple' in xbmc.Player().getPlayingFile(): switchChannel = True except: sys.stdout.write('no channel playing start kill !') if not switchChannel: if curmode == '1': TSPlayer = tsengine() TSPlayer.end() elif curmode == '2': try: sop.killme(linkarray[1]) except: sys.stdout.write('Could not stop sopcast !') currentace = False currentpvr = False linkarray = False link = False curmode = '0' isplay = False elif self.path == '/stop': if curmode == '1': TSPlayer = tsengine() TSPlayer.end() elif curmode == '2': try: sop.killme(linkarray[1]) except: sys.stdout.write('Could not stop sopcast !') else: self.send_response(404) self.send_header('Content-type', 'text/html') self.end_headers() self.wfile.write("404") self.wfile.close()