当前位置: 首页>>代码示例>>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;未经允许,请勿转载。