def start(self, url, filePath, params={}): ''' Owervrite start from BaseDownloader ''' self.url = url self.filePath = filePath self.downloaderParams = params self.fileExtension = '' # should be implemented in future if 'ustream.tv' in url: self.streamSelector = strwithmeta(url).meta.get('iptv_chank_url', '') else: self.streamSelector = strwithmeta(url).meta.get('iptv_bitrate', 0) self.outData = '' self.contentType = 'unknown' baseWgetCmd = DMHelper.getBaseWgetCmd(self.downloaderParams) cmd = DMHelper.GET_F4M_PATH() + (" '%s'" % baseWgetCmd) + (' "%s"' % self.url) + (' "%s"' % self.filePath) + (' %s' % self.streamSelector) + ' > /dev/null' printDBG("F4mDownloader::start cmd[%s]" % cmd) self.console = eConsoleAppContainer() self.console_appClosed_conn = eConnectCallback(self.console.appClosed, self._cmdFinished) self.console_stderrAvail_conn = eConnectCallback(self.console.stderrAvail, self._dataAvail) self.console.execute(E2PrioFix(cmd)) self.status = DMHelper.STS.DOWNLOADING self.onStart() return BaseDownloader.CODE_OK
def isWorkingCorrectly(self, callBackFun): self.iptv_sys = iptv_system( DMHelper.GET_F4M_PATH() + " 2>&1 ", boundFunction(self._checkWorkingCallBack, callBackFun))