當前位置: 首頁>>代碼示例>>Python>>正文


Python DMHelper.getDownloaderParamFromUrl方法代碼示例

本文整理匯總了Python中Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper.getDownloaderParamFromUrl方法的典型用法代碼示例。如果您正苦於以下問題:Python DMHelper.getDownloaderParamFromUrl方法的具體用法?Python DMHelper.getDownloaderParamFromUrl怎麽用?Python DMHelper.getDownloaderParamFromUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper的用法示例。


在下文中一共展示了DMHelper.getDownloaderParamFromUrl方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _startDownloader

# 需要導入模塊: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 別名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getDownloaderParamFromUrl [as 別名]
 def _startDownloader(self, sts, reason):
     if sts:
         self.downloader.subscribeFor_Finish(self.downloadFinished)
         url,downloaderParams = DMHelper.getDownloaderParamFromUrl(self.currItem.get('url', ''))
         self.downloader.start(url, GetTmpDir(self._TMP_FILE_NAME), downloaderParams)
     else:
         self["console"].setText(_("Download can not be started.\nDownloader %s not working correctly.\nStatus[%s]"))
開發者ID:c0ns0le,項目名稱:iptvplayer-for-e2-fork,代碼行數:9,代碼來源:iptvsubsimpledownloader.py

示例2: start

# 需要導入模塊: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 別名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getDownloaderParamFromUrl [as 別名]
 def start(self, uri, mode='loop'):
     self.uri = uri
     self.playMode = mode
     
     gstplayerPath = config.plugins.iptvplayer.gstplayerpath.value
     #'export GST_DEBUG="*:6" &&' + 
     cmd = gstplayerPath  + ' "%s"' % self.uri
     if "://" in self.uri: 
         cmd += ' "%s" "%s"  "%s"  "%s" ' % (self.gstAdditionalParams['download-buffer-path'], self.gstAdditionalParams['ring-buffer-max-size'], self.gstAdditionalParams['buffer-duration'], self.gstAdditionalParams['buffer-size'])
         tmp = strwithmeta(self.uri)
         url,httpParams = DMHelper.getDownloaderParamFromUrl(tmp)
         for key in httpParams: cmd += (' "%s=%s" ' % (key, httpParams[key]) )
         if 'http_proxy' in tmp.meta:
             tmp = tmp.meta['http_proxy']
             if '://' in tmp:
                 if '@' in tmp:
                     tmp = re.search('([^:]+?://)([^:]+?):([^@]+?)@(.+?)$', tmp)
                     if tmp: cmd += (' "proxy=%s" "proxy-id=%s" "proxy-pw=%s" ' % (tmp.group(1)+tmp.group(4), tmp.group(2), tmp.group(3)) )
                 else: cmd += (' "proxy=%s" ' % tmp)
     else:
         cmd = 'exteplayer3 "%s"' % self.uri + " > /dev/null"
     self.console = eConsoleAppContainer()
     self.console_appClosed_conn = eConnectCallback(self.console.appClosed, self._playerFinished)
     printDBG("IPTVSimpleAudioPlayer.start cmd[%s]" % cmd)
     self.console.execute( cmd )
     self.stopped = False
開發者ID:samsamsam-iptvplayer,項目名稱:iptvplayer-for-e2,代碼行數:28,代碼來源:iptvpictureplayer.py

示例3: getResolvedURL

# 需要導入模塊: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 別名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getDownloaderParamFromUrl [as 別名]
 def getResolvedURL(self, url):
     printDBG("LocalMedia.getResolvedURL [%s]" % url)
     videoUrls = []
     
     if url.startswith('/') and fileExists(url):
         url = 'file://'+url
     
     uri, params   = DMHelper.getDownloaderParamFromUrl(url)
     printDBG(params)
     uri = urlparser.decorateUrl(uri, params)
     
     if uri.meta.get('iptv_proto', '') in ['http', 'https']:
         urlSupport = self.up.checkHostSupport( uri )
     else:
         urlSupport = 0
     if 1 == urlSupport:
         retTab = self.up.getVideoLinkExt( uri )
         videoUrls.extend(retTab)
     elif 0 == urlSupport and self._uriIsValid(uri):
         if uri.split('?')[0].endswith('.m3u8'):
             retTab = getDirectM3U8Playlist(uri)
             videoUrls.extend(retTab)
         elif uri.split('?')[0].endswith('.f4m'):
             retTab = getF4MLinksWithMeta(uri)
             videoUrls.extend(retTab)
         else:
             videoUrls.append({'name':'direct link', 'url':uri})
     return videoUrls
開發者ID:c0ns0le,項目名稱:iptvplayer-for-e2-fork,代碼行數:30,代碼來源:hostlocalmedia.py

示例4: startDownloader

# 需要導入模塊: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 別名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getDownloaderParamFromUrl [as 別名]
 def startDownloader(self, sts, reason):
     if sts:
         url,downloaderParams = DMHelper.getDownloaderParamFromUrl( self.cover['src'] )
         self.cover['downloader'] .subscribeFor_Finish(self.downloaderEnd)
         self.cover['downloader'] .start(url, self._getDownloadFilePath(), downloaderParams)
         self.showSpinner()
     else: self.session.openWithCallback(self.close, MessageBox, _("Downloading cannot be started.\n Downloader [%s] not working properly.\n Status[%s]") % (self.cover['downloader'].getName(), reason.strip()), type = MessageBox.TYPE_ERROR, timeout = 10 )        
開發者ID:a4tech,項目名稱:iptvplayer-for-e2,代碼行數:9,代碼來源:iptvarticlerichvisualizer.py

示例5: onStart

# 需要導入模塊: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 別名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getDownloaderParamFromUrl [as 別名]
 def onStart(self):
     self.onLayoutFinish.remove(self.onStart)
     self['progressBar'].value = 0
     self['bufferingBar'].range = (0, 100000)
     self['bufferingBar'].value = 0
     self.initGuiComponentsPos()
     if 'gstplayer' == self.player:
         gstplayerPath = config.plugins.iptvplayer.gstplayerpath.value
         #'export GST_DEBUG="*:6" &&' + 
         cmd = gstplayerPath  + ' "%s"' % self.fileSRC
         if "://" in self.fileSRC: 
             cmd += ' "%s" "%s"  "%s"  "%s" ' % (self.gstAdditionalParams['download-buffer-path'], self.gstAdditionalParams['ring-buffer-max-size'], self.gstAdditionalParams['buffer-duration'], self.gstAdditionalParams['buffer-size'])
             tmp = strwithmeta(self.fileSRC)
             url,httpParams = DMHelper.getDownloaderParamFromUrl(tmp)
             for key in httpParams: cmd += (' "%s=%s" ' % (key, httpParams[key]) )
             if 'http_proxy' in tmp.meta:
                 tmp = tmp.meta['http_proxy']
                 if '://' in tmp:
                     if '@' in tmp:
                         tmp = re.search('([^:]+?://)([^:]+?):([^@]+?)@(.+?)$', tmp)
                         if tmp: cmd += (' "proxy=%s" "proxy-id=%s" "proxy-pw=%s" ' % (tmp.group(1)+tmp.group(4), tmp.group(2), tmp.group(3)) )
                     else: cmd += (' "proxy=%s" ' % tmp)
     else:
         cmd = 'exteplayer3 "%s"' % self.fileSRC + " > /dev/null"
     
     self.console = eConsoleAppContainer()
     self.console_appClosed_conn = eConnectCallback(self.console.appClosed, self.eplayer3Finished)
     self.console_stderrAvail_conn = eConnectCallback(self.console.stderrAvail, self.eplayer3DataAvailable)
     #if 'gstplayer' == self.player: 
     #    self.console_stdoutAvail_conn = eConnectCallback(self.console.stdoutAvail, self.eplayer3DataAvailable2 ) # work around to catch EOF event after seeking, pause .etc
     printDBG("onStart cmd[%s]" % cmd)
     self.console.execute( cmd )
     self['statusIcon'].setPixmap( self.playback['statusIcons']['Play'] ) # sulge for test
開發者ID:samsamsam-iptvplayer,項目名稱:iptvplayer-for-e2,代碼行數:35,代碼來源:iptvextmovieplayer.py

示例6: _startDownloader

# 需要導入模塊: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 別名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getDownloaderParamFromUrl [as 別名]
 def _startDownloader(self, sts, reason):
     if sts:
         url,downloaderParams = DMHelper.getDownloaderParamFromUrl(self.url)
         if self._isFlvInfiniteFile(self.url):
             ret = touch(self.GST_FLV_DEMUX_IS_DEMUXING_INFINITE_FILE) # TODO: check returns value, and display message in case of False
         self.downloader.start(url, self.filePath, downloaderParams)
         self.setMainTimerSts(True)
         self.canRunMoviePlayer = True
     else:
         self.session.openWithCallback(self.close, MessageBox, _("Pobieranie nie może zostać rozpoczęte.\n Downloader %s nie działa prawidłowo.\nStatus[%s]") % (self.downloader.getName(), reason.strip()), type = MessageBox.TYPE_ERROR, timeout = 10 )
開發者ID:a4tech,項目名稱:iptvplayer-for-e2,代碼行數:12,代碼來源:iptvbuffui.py

示例7: _doStart

# 需要導入模塊: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 別名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getDownloaderParamFromUrl [as 別名]
 def _doStart(self, force=False):
     if self.autoRefresh or force:
         self.refreshing = True
         self.downloader = DownloaderCreator(self.url)
         
         url,downloaderParams = DMHelper.getDownloaderParamFromUrl(self.url)
         self.downloader.subscribeFor_Finish(self.downloaderEnd)
         self.downloader.start(url, self._getDownloadFilePath(), downloaderParams)
         self.setMainTimerSts(True)
     else: self.refreshing = False
開發者ID:samsamsam-iptvplayer,項目名稱:iptvplayer-for-e2,代碼行數:12,代碼來源:iptvpictureplayer.py

示例8: runCMD

# 需要導入模塊: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 別名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getDownloaderParamFromUrl [as 別名]
    def runCMD(self, item):
        printDBG("runCMD for downloadIdx[%d]" % item.downloadIdx)
        
        if DMHelper.DOWNLOAD_TYPE.INITIAL == item.tries:
           item.fileName = DMHelper.makeUnikalFileName(item.fileName, False, False)

        printDBG("Downloading started downloadIdx[%s] File[%s] URL[%s]" % (item.downloadIdx, item.fileName, item.url) )
      
        listUDIdx = self.findIdxInQueueUD(item.downloadIdx)
        self.queueUD[listUDIdx].status      = DMHelper.STS.DOWNLOADING
        self.queueUD[listUDIdx].fileName    = item.fileName
        
        url, downloaderParams = DMHelper.getDownloaderParamFromUrl(item.url)
        self.queueUD[listUDIdx].downloader = DownloaderCreator(url)
        self.queueUD[listUDIdx].callback   = boundFunction(self.cmdFinished, item.downloadIdx)
        self.queueUD[listUDIdx].downloader.subscribeFor_Finish( self.queueUD[listUDIdx].callback )
        self.queueUD[listUDIdx].downloader.start(url, item.fileName, downloaderParams)
開發者ID:a4tech,項目名稱:iptvplayer-for-e2,代碼行數:19,代碼來源:iptvdmapi.py

示例9: getLinksForVideo

# 需要導入模塊: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 別名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getDownloaderParamFromUrl [as 別名]
 def getLinksForVideo(self, cItem):
     printDBG("Urllist.getLinksForVideo url[%s]" % cItem['url'])
     videoUrls = []
     uri, params   = DMHelper.getDownloaderParamFromUrl(cItem['url'])
     printDBG(params)
     uri = urlparser.decorateUrl(uri, params)
     
     urlSupport = self.up.checkHostSupport( uri )
     if 1 == urlSupport:
         retTab = self.up.getVideoLinkExt( uri )
         videoUrls.extend(retTab)
     elif 0 == urlSupport and self._uriIsValid(uri):
         if uri.split('?')[0].endswith('.m3u8'):
             retTab = getDirectM3U8Playlist(uri)
             videoUrls.extend(retTab)
         elif uri.split('?')[0].endswith('.f4m'):
             retTab = getF4MLinksWithMeta(uri)
             videoUrls.extend(retTab)
         else:
             videoUrls.append({'name':'direct link', 'url':uri})
     return videoUrls
開發者ID:friman,項目名稱:iptvplayer-for-e2,代碼行數:23,代碼來源:hosturllist.py


注:本文中的Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper.getDownloaderParamFromUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。