def startRecording(model, link): session = Livestreamer() streams = session.streams("hls://http://transcode.k8s-do.naked.com/hls/" + link + "/index.m3u8") stream = streams["best"] fd = stream.open() ts = time.time() st = datetime.datetime.fromtimestamp(ts).strftime("%Y.%m.%d_%H.%M.%S") if not os.path.exists("{path}/{model}".format(path=save_directory, model=model)): os.makedirs("{path}/{model}".format(path=save_directory, model=model)) with open( "{path}/{model}/{st}_{model}.mp4".format(path=save_directory, model=model, st=st), 'wb') as f: recording.append(model.lower()) while True: try: data = fd.read(1024) f.write(data) except: recording.remove(model) f.close() return ()
def stream(videoServerUrl, model): session = Livestreamer() session.set_option('http-headers', 'referer=https://bongacams.com/%s' % model) url = 'hlsvariant://https:%s/hls/stream_%s/playlist.m3u8' % ( videoServerUrl, model) streams = session.streams(url) stream = streams['best'] fd = stream.open() now = datetime.datetime.now() filePath = '%s/%s.mp4' % (model, model + now.strftime('%Y-%m-%d-%H-%M')) print(' - Start record stream') if not os.path.exists(model): os.makedirs(model) with open(filePath, 'wb') as f: while True: try: data = fd.read(1024) f.write(data) except: print(' - Error write record into file') f.close() return
def open(self, url, quality): """Attempt to open stream from *url*. Exits with '-1' (using self.exit()) in case of error, including an error msg. """ self.original_url = url try: self.livestreamer = Livestreamer() self._load_config() streams = self.livestreamer.streams(url) except NoPluginError: self.exit( "Livestreamer is unable to handle the URL '{}'".format(url)) except PluginError as err: self.exit("Plugin error: {}".format(err)) if quality not in streams: print("Unable to find '{}' stream on URL '{}'".format( quality, url), file=sys.stderr) self.exit("List of available streams: {}".format( sorted(streams.keys()))) self.stream = streams[quality] try: self.fd = self.stream.open() except StreamError as err: self.exit("Failed to open stream: {}".format(err))
def GetYoutubeFullLink(url): from livestreamer import Livestreamer livestr = Livestreamer() channel = livestr.resolve_url(url) streams = channel.get_streams() stream = streams["best"] return stream.url
def startRecording(model): try: session = Livestreamer() url = get.stream(model) if url == 'Offline': return recording.append(model.lower()) streams = session.streams("hlsvariant://" + url) stream = streams["best"] fd = stream.open() ts = time.time() st = datetime.datetime.fromtimestamp(ts).strftime("%Y%m%d_%H%M%S") file_path = "{path}/{model}/{st}-{model}.mp4".format( path=settings['save_directory'], model=model, st=st) directory = file_path.rsplit('/', 1)[0] + '/' if not os.path.exists(directory): os.makedirs(directory) with open(file_path, 'wb') as f: while True: try: data = fd.read(1024) f.write(data) except: break finally: os.system('rclone move "{}" milo:milo/b/MFC/"{}"'.format( file_Path, model)) if model.lower() in recording: recording.remove(model.lower()) if settings['post_processing_command']: processing_queue.put({'model': model, 'path': file_path})
def __init__(self): self.gchoice = -1 self.cchoice = -1 self.exit_now = False self.state = 'none' self.keybingings = { ord('q'): self.quit, ord('f'): self.get_favorites, ord('s'): self.get_fav_games, ord('g'): self.get_games, ord('n'): self.get_next, ord('r'): self.refresh, ord('p'): self.get_previous } self.games = [] self.favs = [] self.channels = [] self.twitch = Twitch(config.get('settings', 'twitchapiurl'), config.get('settings', 'channel'), config.get('settings', 'game')) self.livestreamer = Livestreamer() try: self.run() except Exception as e: print e.message
def _init_stream(self, oauth, channel): session = Livestreamer() session.set_plugin_option(self.LIVESTREAMER_PLUGIN_TWITCH, self.OAUTH_TOKEN_KEY, oauth) session.set_option(self.RING_BUFFER_SIZE_KEY, self.buffer_size) streams = session.streams(self._generate_stream_url(channel)) return streams.get(self.resolution)
def start(portNum): global LIVESTREAMER LIVESTREAMER = Livestreamer() global httpd httpd = ThreadedHTTPServer(("localhost", portNum), StreamHandler) print "Livestreamer: Server Starts - {0}:{1}".format("localhost", portNum) try: httpd.serve_forever() except: pass
def _getLiveUrl(target): livestreamer = Livestreamer() streams = livestreamer.streams("http://www.twitch.tv/" + target) print(streams) if streams: # default # xx = streams.popitem() # return xx[1].url xx = streams.get('high') return xx.url return None
def serveFile(self, fURL, sendData): from livestreamer import Livestreamer, StreamError, PluginError, NoPluginError session = Livestreamer() if '|' in fURL: sp = fURL.split('|') fURL = sp[0] headers = dict(urlparse.parse_qsl(sp[1])) session.set_option("http-headers", headers) cookies = dict(urlparse.parse_qsl(sp[2])) session.set_option("http-cookie", cookies) streams = session.streams(fURL) except:
def test_start(model): model_link_api = 'https://chaturbate.com/api/chatvideocontext/' + model + '/' result = requests.get(model_link_api).json() session = Livestreamer() session.set_option('http-header',"referer=https://www.chaturbate.com/{}/".format(model)) stream = session.streams("hlsvariant://{}".format(result['hls_source'].rsplit('?')[0])) stream = stream['best'] fd = stream.open() with open(model + '.mp4', 'wb') as file: while True: data = fd.read(1024) file.write(data)
def watch(url): session = Livestreamer() session.set_loglevel('info') session.set_logoutput(sys.stdout) session.set_option('http-headers', 'Client-ID=jzkbprff40iqj646a697cyrvl0zt2m6') streams = session.streams(url) stream = streams['audio_only'] fd = stream.open() # read to nowhere while True: fd.read(1024)
def serveFile(self, fURL, sendData): session = Livestreamer() if '|' in fURL: sp = fURL.split('|') fURL = sp[0] headers = dict(urlparse.parse_qsl(sp[1])) #print headers if 'cdn.sstream.pw' in fURL: fURL = fURL.replace('cdn.sstream.pw', random.choice(s)) headers[ 'Host'] = '6b6473616a6b6c647361646a7361643737353637647361393973616768647368686464732e736974656e6f772e6d65'.decode( 'hex') session.set_option("http-headers", headers) session.set_option("http-ssl-verify", False) session.set_option("hls-segment-threads", 3) try: streams = session.streams(fURL) except: traceback.print_exc(file=sys.stdout) self.send_response(403) self.send_response(200) #print "XBMCLocalProxy: Sending headers..." self.end_headers() if (sendData): print "XBMCLocalProxy: Sending data..." fileout = self.wfile try: stream = streams["best"] print streams try: response = stream.open() buf = 'INIT' while (buf != None and len(buf) > 0): buf = response.read(200 * 1024) fileout.write(buf) fileout.flush() response.close() fileout.close() #print time.asctime(), "Closing connection" except socket.error, e: #print time.asctime(), "Client Closed the connection." try: response.close() fileout.close() except Exception, e: return except Exception, e: traceback.print_exc(file=sys.stdout) response.close() fileout.close()
def __init__(self, threadID, output_location, name, yt_stream, start_time): threading.Thread.__init__(self) self.threadID = threadID self.output = os.path.abspath(output_location) self.name = name self.start_time = start_time self.bufferSize = 1024 self.maxSize = self.bufferSize * 1024 * 50 # 10 MB videos self.livestreamer = Livestreamer() self.numOfIndexes = 5 self.outFiles = [] self.yt_stream = yt_stream.strip('\'"')
def startRecording(modelData, num): try: recording.append(modelData['username'].lower()) with urllib.request.urlopen( "https://www.camsoda.com/api/v1/video/vtoken/{model}?username=guest_{num}" .format(model=modelData['username'], num=num)) as videoapi: data2 = json.loads(videoapi.read().decode()) if str(modelData['status']) != 'limited': if str(modelData['status']) == 'private': server = data2['private_servers'][0] elif modelData['status'] == 'online': server = data2['edge_servers'][0] else: server = data2['mjpeg_server'] link = "hlsvariant://https://{server}/{app}/mp4:{stream_name}_mjpeg/playlist.m3u8?token={token}".format( server=server, app=data2['app'], stream_name=data2['stream_name'], token=data2['token']) if not os.path.exists("{path}/{model}".format( path=save_directory, model=modelData['username'])): os.makedirs("{path}/{model}".format( path=save_directory, model=modelData['username'])) session = Livestreamer() streams = session.streams(link) stream = streams["best"] fd = stream.open() ts = time.time() st = datetime.datetime.fromtimestamp(ts).strftime( "%Y.%m.%d_%H.%M.%S") with open( "{path}/{model}/{st}_{model}.mp4".format( path=save_directory, model=modelData['username'], st=st), 'wb') as f: while True: try: data = fd.read(1024) f.write(data) except: recording.remove(modelData['username'].lower()) #print("{} stream has ended".format(modelData['username'])) f.close() return () recording.remove(modelData['username'].lower()) #print("{} stream has ended".format(modelData['username'])) except: recording.remove(modelData['username'].lower())
def serveFile(self, fURL, sendData): if (sendData): fURL, quality = player.GetStreamUrl(unquote(fURL)) session = Livestreamer() if '|' in fURL: sp = fURL.split('|') fURL = sp[0] headers = dict(urlparse.parse_qsl(sp[1])) session.set_option("http-headers", headers) session.set_option("http-ssl-verify", False) session.set_option("hls-segment-threads", 3) session.set_option("stream-segment-threads", 3) try: #streams = session.streams(fURL) channel = session.resolve_url(fURL) streams = channel.get_streams() except Exception as ex: traceback.print_exc(file=sys.stdout) self.send_response(403) self.send_response(200) #print "XBMCLocalProxy: Sending headers..." self.end_headers() #print "XBMCLocalProxy: Sending data..." fileout = self.wfile try: stream = streams[quality] try: response = stream.open() buf = 'INIT' while (buf != None and len(buf) > 0): buf = response.read(200 * 1024) fileout.write(buf) fileout.flush() response.close() fileout.close() #print time.asctime(), "Closing connection" except socket.error, e: #print time.asctime(), "Client Closed the connection." try: response.close() fileout.close() except Exception, e: return except Exception, e: traceback.print_exc(file=sys.stdout) response.close() fileout.close()
def startRecording(model): global postProcessingCommand global processingQueue try: result = requests.get('https://chaturbate.com/api/chatvideocontext/{}/'.format(model)).text result = json.loads(result) session = Livestreamer() session.set_option('http-headers', "referer=https://www.chaturbate.com/{}".format(model)) streams = session.streams("hlsvariant://{}".format(result['hls_source'].rsplit('?')[0])) stream = streams["best"] fd = stream.open() now = datetime.datetime.now() filePath = directory_structure.format(path=save_directory, model=model, gender=result['broadcaster_gender'], seconds=now.strftime("%S"), minutes=now.strftime("%M"), hour=now.strftime("%H"), day=now.strftime("%d"), month=now.strftime("%m"), year=now.strftime("%Y")) directory = filePath.rsplit('/', 1)[0]+'/' if not os.path.exists(directory): os.makedirs(directory) with open(filePath, 'wb') as f: recording.append(model) while True: try: data = fd.read(1024) f.write(data) except: f.close() recording.remove(model) if postProcessingCommand != "": processingQueue.put({'model':model, 'path':filePath, 'gender':gender}) elif completed_directory != "": finishedDir = completed_directory.format(path=save_directory, model=model, gender=gender, seconds=now.strftime("%S"), minutes=now.strftime("%M"), hour=now.strftime("%H"), day=now.strftime("%d"), month=now.strftime("%m"), year=now.strftime("%Y")) if not os.path.exists(finishedDir): os.makedirs(finishedDir) os.rename(filePath, finishedDir+'/'+filePath.rsplit['/',1][0]) return if model in recording: recording.remove(model) except: if model in recording: recording.remove(model)
def __init__(self, model, save_directory): self.__model = model self.save_directory = save_directory options_url = 'https://it.chaturbate.com/api/chatvideocontext/{}'.format( model) self.options = json.loads(requests.get(options_url).content) self.session = Livestreamer() self.session.set_option('http-headers', 'referer={}'.format(options_url)) self.streams = None self.__get_live_streams() self.__record_status = True
def startRecording(model): try: model = model.lower() req = urllib.request.Request('https://www.cam4.com/' + model) req.add_header('UserAgent', UserAgent) resp = urllib.request.urlopen(req) resp = resp.read().decode().splitlines() videoPlayUrl = "" videoAppUrl = "" for line in resp: if "videoPlayUrl" in line: for part in line.split("&"): if "videoPlayUrl" in part and videoPlayUrl == "": videoPlayUrl = part[13:] elif "videoAppUrl" in part and videoAppUrl == "": videoAppUrl = part.split("//")[1] session = Livestreamer() session.set_option('http-headers', "referer=https://www.cam4.com/{}".format(model)) streams = session.streams( "hlsvariant://https://{}/amlst:{}_aac/playlist.m3u8?referer=www.cam4.com×tamp={}" .format(videoAppUrl, videoPlayUrl, str(int(time.time() * 1000)))) stream = streams["best"] fd = stream.open() ts = time.time() st = datetime.datetime.fromtimestamp(ts).strftime("%Y.%m.%d_%H.%M.%S") if not os.path.exists("{path}/{model}".format(path=save_directory, model=model)): os.makedirs("{path}/{model}".format(path=save_directory, model=model)) with open( "{path}/{model}/{st}_{model}.mp4".format(path=save_directory, model=model, st=st), 'wb') as f: recording.append(model) while True: try: data = fd.read(1024) f.write(data) except: recording.remove(model) if model in recording: recording.remove(model) except: if model in recording: recording.remove(model)
def serveFile(self, fURL, sendData): session = Livestreamer() if '|' in fURL: sp = fURL.split('|') fURL = sp[0] headers = dict(urlparse.parse_qsl(sp[1])) print 'LocalProxy: Headers : %s' % headers session.set_option("http-headers", headers) session.set_option("http-ssl-verify", False) session.set_option("hls-segment-threads", 3) try: streams = session.streams(fURL) print "LocalProxy: Streams %s" % streams except: traceback.print_exc() self.send_response(404) self.send_response(200) print "LocalProxy: Sending headers..." self.end_headers() if (sendData): print "LocalProxy: Sending data..." fileout = self.wfile try: stream = streams["best"] try: response = stream.open() buf = 'INIT' while (buf != None and len(buf) > 0): buf = response.read(200 * 1024) fileout.write(buf) fileout.flush() response.close() fileout.close() print time.asctime(), "LocalProxy: Closing connection" except socket.error, e: print time.asctime( ), "LocalProxy: Client Closed the connection." try: response.close() fileout.close() except Exception, e: return except Exception, e: traceback.print_exc() response.close() fileout.close()
def get_streams(self): live = Livestreamer() print self.url live.set_option("http-ssl-verify", False) streams = None live.load_plugins(os.path.join(os.getcwd(), "plugins")) try: plugin = live.resolve_url(self.url) streams = plugin.get_streams() self.play_url = stream_to_url(streams.get("best")) except NoPluginError: print("No plugin can handle URL") except PluginError as err: print("{0}", err)
def startRecording(model): try: URL = "https://chaturbate.com/{}/".format(model) result = urllib.request.urlopen(URL) result = result.read().decode() for line in result.splitlines(): if "m3u8" in line: stream = line.split("'")[1] break soup = BeautifulSoup(result, 'lxml') soup = soup.findAll('div', id="tabs_content_container") for line in str(soup).split(): if 'Sex:' in line: gender = line.split("</dt><dd>")[1][:-5].lower() session = Livestreamer() session.set_option('http-headers', "referer=https://www.cam4.com/{}".format(model)) streams = session.streams("hlsvariant://{}".format(stream)) stream = streams["best"] fd = stream.open() ts = time.time() st = datetime.datetime.fromtimestamp(ts).strftime("%d.%m.%Y_%H.%M.%S") if not os.path.exists("{path}/{model}_{gender}".format( path=save_directory, model=model, gender=gender)): os.makedirs("{path}/{model}_{gender}".format(path=save_directory, model=model, gender=gender)) with open( "{path}/{model}_{gender}/{st}_{model}_{gender}.mp4".format( path=save_directory, model=model, gender=gender, st=st), 'wb') as f: recording.append(model) while True: try: data = fd.read(1024) f.write(data) except: f.close() recording.remove(model) return if model in recording: recording.remove(model) except: if model in recording: recording.remove(model)
def main(): session = Livestreamer() session.set_option("http-headers", "Client-ID=jzkbprff40iqj646a697cyrvl0zt2m6") streams = session.streams("twitch.tv/tsm_myth") stream = streams['720p60'] fname = "downloading.mpg" vid_file = open(fname, "wb") fd = stream.open() new_bytes = 0 for i in range(0, 8 * 1024): new_bytes = fd.read(2048) vid_file.write(new_bytes) print "Done buffering." startReadingFrames(fname, vid_file, fd)
def serveFile(self, fURL, sendData): from livestreamer import Livestreamer, StreamError, PluginError, NoPluginError session = Livestreamer() if '|' in fURL: sp = fURL.split('|') fURL = sp[0] headers = dict(urlparse.parse_qsl(sp[1])) session.set_option("http-headers", headers) session.set_option("http-ssl-verify", False) try: streams = session.streams(fURL) except: traceback.print_exc(file=sys.stdout) self.send_response(403) self.send_response(200) #print "XBMCLocalProxy: Sending headers..." self.end_headers() if (sendData): #print "XBMCLocalProxy: Sending data..." fileout = self.wfile try: stream = streams["best"] try: response = stream.open() buf = 'INIT' while (buf != None and len(buf) > 0): buf = response.read(300 * 1024) fileout.write(buf) fileout.flush() response.close() fileout.close() #print time.asctime(), "Closing connection" except socket.error, e: #print time.asctime(), "Client Closed the connection." try: response.close() fileout.close() except Exception, e: return except Exception, e: traceback.print_exc(file=sys.stdout) response.close() fileout.close()
def start(portNum): global LIVESTREAMER LIVESTREAMER = Livestreamer() LIVESTREAMER.set_option('hls-segment-threads', '3') LIVESTREAMER.set_option('hds-segment-threads', '3') LIVESTREAMER.set_option('stream-segment-threads', '3') global httpd #httpd = ThreadedHTTPServer(('', portNum), StreamHandler) httpd = StoppableHTTPServer(('', portNum), StreamHandler) try: #thread.start_new_thread(httpd.serve, ()) t1 = threading.Thread(target = httpd.serve, args = ()) t1.daemon = True t1.start() xbmc.log("Livestreamer: Server Starts - {0}:{1}".format("localhost", portNum), 2) except Exception as ex: xbmc.log("{0}".format(ex), 3)
def main(): if len(sys.argv) < 3: exit("Usage: {0} <url> <quality>".format(sys.argv[0])) # Initialize and check GStreamer version gi.require_version("Gst", "1.0") gobject.threads_init() gst.init(None) # Collect arguments url = sys.argv[1] quality = sys.argv[2] # Create the Livestreamer session livestreamer = Livestreamer() # Enable logging livestreamer.set_loglevel("info") livestreamer.set_logoutput(sys.stdout) # Attempt to fetch streams try: streams = livestreamer.streams(url) except NoPluginError: exit("Livestreamer is unable to handle the URL '{0}'".format(url)) except PluginError as err: exit("Plugin error: {0}".format(err)) if not streams: exit("No streams found on URL '{0}'".format(url)) # Look for specified stream if quality not in streams: exit("Unable to find '{0}' stream on URL '{1}'".format(quality, url)) # We found the stream stream = streams[quality] # Create the player and start playback player = LivestreamerPlayer() # Blocks until playback is done player.play(stream)
def startRecording(model): try: recording[model['uid']] = model['nm'] session = Livestreamer() streams = session.streams("hlsvariant://http://video{srv}.myfreecams.com:1935/NxServer/ngrp:mfc_{id}.f4v_mobile/playlist.m3u8" .format(id=(int(model['uid']) + 100000000), srv=(int(model['camserv']) - 500))) stream = streams["best"] fd = stream.open() now = datetime.datetime.now() filePath = directory_structure.format(path=save_directory, model=model['nm'], uid=model['uid'], seconds=now.strftime("%S"), day=now.strftime("%d"), minutes=now.strftime("%M"), hour=now.strftime("%H"), month=now.strftime("%m"), year=now.strftime("%Y")) directory = filePath.rsplit('/', 1)[0]+'/' if not os.path.exists(directory): os.makedirs(directory) with open(filePath, 'wb') as f: minViewers = filter['autoStopViewers'] if model['condition'] == 'viewers' else filter['stopViewers'] while modelDict[model['uid']]['rc'] >= minViewers: try: data = fd.read(1024) f.write(data) except: f.close() recording.pop(model['uid'], None) recording.pop(model['uid'], None) if postProcessingCommand != "": processingQueue.put({'model':model['nm'], 'path': filePath, 'uid':model['uid']}) elif completed_directory != "": finishedDir = completed_directory.format(path=save_directory, model=model, uid=model['uid'], seconds=now.strftime("%S"), minutes=now.strftime("%M"), hour=now.strftime("%H"), day=now.strftime("%d"), month=now.strftime("%m"), year=now.strftime("%Y")) if not os.path.exists(finishedDir): os.makedirs(finishedDir) os.rename(filePath, finishedDir+'/'+filePath.rsplit('/', 1)[1]) return finally: recording.pop(model['uid'], None)
def __init__(self, session, streamFile=None): self.session = session Screen.__init__(self, session) self['info'] = Label('...') self['actions'] = ActionMap( [ 'OkCancelActions', 'ShortcutActions', 'WizardActions', 'ColorActions', 'SetupActions', 'NumberActions', 'MenuActions' ], { 'ok': self.keyOK, 'cancel': self.keyCancel, 'up': self.keyUp, 'down': self.keyDown, 'left': self.keyLeft, 'right': self.keyRight }, -1) self.streamBin = '/usr/bin/rtmpdump' self.streamPipe = '/tmp/greekstreamtv.avi' if not streamFile: self.streamFile = resolveFilename( SCOPE_PLUGINS, 'Extensions/GreekStreamTV/stream.xml') else: self.streamFile = streamFile self.lvstreamer = Livestreamer() self.streamList = [] self.makeStreamList() self.streamMenuList = MenuList([], enableWrapAround=True, content=eListboxPythonMultiContent) self.streamMenuList.l.setFont(0, gFont('Regular', 22)) self.streamMenuList.l.setFont(1, gFont('Regular', 18)) self.streamMenuList.l.setItemHeight(37) self['streamlist'] = self.streamMenuList self.streamMenuList.setList(map(streamListEntry, self.streamList)) self.onLayoutFinish.append(self.layoutFinished) self.beforeService = None self.currentService = None self.playerStoped = False self.keyLocked = False self.pd = None self.qsel = None return
def main(): if len(sys.argv) < 3: exit("Usage: {0} <url> <quality>".format(sys.argv[0])) # Collect arguments url = sys.argv[1] quality = sys.argv[2] # Create the Livestreamer session livestreamer = Livestreamer() # Enable logging livestreamer.set_loglevel("info") livestreamer.set_logoutput(sys.stdout) # Attempt to find a plugin for this URL try: plugin = livestreamer.resolve_url(url) except NoPluginError: exit("Livestreamer is unable to handle the URL '{0}'".format(url)) # Attempt to fetch streams try: streams = plugin.get_streams() except PluginError as err: exit("Plugin error: {0}".format(err)) if len(streams) == 0: exit("No streams found on URL '{0}'".format(url)) # Look for specified stream if quality not in streams: exit("Unable to find '{0}' stream on URL '{1}'".format(quality, url)) # We found the stream stream = streams[quality] # Create the player and start playback player = LivestreamerPlayer() # Blocks until playback is done player.play(stream)
def __init__(self, session, streamFile=None): Screen.__init__(self, session) self.setTitle(_("GreekStreamTV list")) self["info"] = Label("...") self["key_red"] = StaticText(_("Cancel")) self["key_green"] = StaticText(_("Play")) self["actions"] = ActionMap(["OkCancelActions", "WizardActions", "ColorActions"], { "ok" : self.keyOK, "green" : self.keyOK, "cancel": self.keyCancel, "red" : self.keyCancel, "up" : self.keyUp, "down" : self.keyDown, "left" : self.keyLeft, "right" : self.keyRight, }, -1) self.streamBin = "/usr/bin/rtmpdump" self.streamPipe = "/tmp/greekstreamtv.avi" if not streamFile: self.streamFile = resolveFilename(SCOPE_PLUGINS, "Extensions/GreekStreamTV/stream.xml") else: self.streamFile = streamFile self.lvstreamer = Livestreamer() self.streamList = [] self.makeStreamList() self["streamlist"] = StreamList(self.streamList) self.onLayoutFinish.append(self.layoutFinished) self.beforeService = None self.currentService = None self.playerStoped = False self.keyLocked = False self.pd = None self.qsel = None