当前位置: 首页>>代码示例>>Python>>正文


Python DMHelper.getBaseWgetCmd方法代码示例

本文整理汇总了Python中Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper.getBaseWgetCmd方法的典型用法代码示例。如果您正苦于以下问题:Python DMHelper.getBaseWgetCmd方法的具体用法?Python DMHelper.getBaseWgetCmd怎么用?Python DMHelper.getBaseWgetCmd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper的用法示例。


在下文中一共展示了DMHelper.getBaseWgetCmd方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: doDowanloadSubtitle

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
 def doDowanloadSubtitle(self, callback, subItem, tmpDir, subDir):
     self.outerCallback = callback
     self.tmpData = {'subItem':subItem, 'tmpDir':tmpDir, 'subDir':subDir}
     # subItem === private_data
     
     tmpFile = tmpDir + OpenSubOrgProvider.TMP_FILE_NAME
     self.filesToRemove.append(tmpFile)
     self.tmpData['tmpFile'] = tmpFile
     tmpFile = " '{0}' ".format(tmpFile)
     
     if not subItem.get('napisy_24', False):
         params = {'User-Agent': OpenSubOrgProvider.USER_AGENT}
         url     = " '{0}' ".format(subItem['SubDownloadLink'])
         cmd = DMHelper.getBaseWgetCmd(params) + url + ' -O ' + tmpFile + ' > /dev/null 2>&1 '
         printDBG('doDowanloadSubtitle cmd[%s]' % cmd)
         self.iptv_sys = iptv_system(cmd, self._doDowanloadSubtitleCallback)
     else:
         tmpFileZip = self.tmpData['tmpFile'] + '.zip'
         self.tmpData['tmpFileZip'] = tmpFileZip
         self.filesToRemove.append(tmpFileZip)
         tmpFileZip = " '{0}' ".format(tmpFileZip)
         params = {'User-Agent': self.NAPISY24_USER_AGENT, 'Referer':'http://napisy24.pl/'}
         url     = "'http://napisy24.pl/run/pages/download.php?napisId={0}&typ=sr'".format(subItem['id'])
         cmd = DMHelper.getBaseWgetCmd(params) + url + ' -O ' + tmpFileZip + ' > /dev/null 2>&1 '
         printDBG('_doSearchSubtitleNapisy24Callback cmd[%s]' % cmd)
         self.iptv_sys = iptv_system(cmd, self._doDowanloadSubtitle24Callback)
开发者ID:c0ns0le,项目名称:iptvplayer-for-e2-fork,代码行数:28,代码来源:opensubtitlesorg.py

示例2: doDowanloadSubtitle

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
    def doDowanloadSubtitle(self, callback, subItem, tmpDir, subDir):
        self.outerCallback = callback
        self.tmpData = {"subItem": subItem, "tmpDir": tmpDir, "subDir": subDir}
        # subItem === private_data

        tmpFile = tmpDir + OpenSubOrgProvider.TMP_FILE_NAME
        self.filesToRemove.append(tmpFile)
        self.tmpData["tmpFile"] = tmpFile
        tmpFile = " '{0}' ".format(tmpFile)

        if not subItem.get("napisy_24", False):
            params = {"User-Agent": OpenSubOrgProvider.USER_AGENT}
            url = " '{0}' ".format(subItem["SubDownloadLink"])
            cmd = DMHelper.getBaseWgetCmd(params) + url + " -O " + tmpFile + " > /dev/null 2>&1 "
            printDBG("doDowanloadSubtitle cmd[%s]" % cmd)
            self.iptv_sys = iptv_system(cmd, self._doDowanloadSubtitleCallback)
        else:
            tmpFileZip = self.tmpData["tmpFile"] + ".zip"
            self.tmpData["tmpFileZip"] = tmpFileZip
            self.filesToRemove.append(tmpFileZip)
            tmpFileZip = " '{0}' ".format(tmpFileZip)
            params = {"User-Agent": self.NAPISY24_USER_AGENT, "Referer": "http://napisy24.pl/"}
            url = "'http://napisy24.pl/run/pages/download.php?napisId={0}&typ=sr'".format(subItem["id"])
            cmd = DMHelper.getBaseWgetCmd(params) + url + " -O " + tmpFileZip + " > /dev/null 2>&1 "
            printDBG("_doSearchSubtitleNapisy24Callback cmd[%s]" % cmd)
            self.iptv_sys = iptv_system(cmd, self._doDowanloadSubtitle24Callback)
开发者ID:a4tech,项目名称:iptvplayer-for-e2,代码行数:28,代码来源:opensubtitlesorg.py

示例3: _startFragment

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
    def _startFragment(self, tryAgain=False):
        printDBG("_startFragment tryAgain[%r]" % tryAgain)
        self.outData = ''
        self.remoteFragmentSize = -1
        self.remoteFragmentType = 'unknown'
                            
        if 0 > self.localFileSize:
            self.m3u8_prevLocalFileSize = 0
        else:
            self.m3u8_prevLocalFileSize = self.localFileSize
        ##############################################################################
        # frist download nextFragment conntent
        ##############################################################################
        self.downloadType = self.DOWNLOAD_TYPE.SEGMENT
 
        if None != self.console:
            self.console_appClosed_conn = None
            self.console_stderrAvail_conn = None
        #self.console = eConsoleAppContainer()
        self.console_appClosed_conn = eConnectCallback(self.console.appClosed,  self._cmdFinished )
        self.console_stderrAvail_conn = eConnectCallback(self.console.stderrAvail, self._dataAvail )
        
        if tryAgain and self.tries >= self.MAX_RETRIES:
            if not self.liveStream:
                return DMHelper.STS.INTERRUPTED
            else:
                # even if fragment is lost this is not big problem, download next one, 
                # this is a live stream this can happen :)
                tryAgain = False
            
        currentFragment = None
        if False == tryAgain:
            self.tries = 0
            if (self.currentFragment + 1) < len(self.fragmentList):
                self.currentFragment += 1
                currentFragment = self.fragmentList[self.currentFragment]  
        else:
            self.tries += 1
            currentFragment = self.fragmentList[self.currentFragment]        
        
        if None != currentFragment:
            self.wgetStatus = self.WGET_STS.CONNECTING
            cmd = DMHelper.getBaseWgetCmd(self.downloaderParams) + (' --tries=1 --timeout=%d ' % self._getTimeout()) + '"' + currentFragment + '" -O - >> "' + self.filePath + '"'
            printDBG("Download cmd[%s]" % cmd)
            self.console.execute( E2PrioFix( cmd ) )
            
            #with open("/home/sulge/tmp/m3u8.txt", "a") as myfile:
            #with open("/hdd/dbg_m3u8.txt", "a") as myfile:
            #    myfile.write(currentFragment+"\n")
                
            return DMHelper.STS.DOWNLOADING
        else:
            if self.liveStream:
                # we are in live so wait for new fragments
                printDBG("m3u8 downloader - wait for new fragments ----------------------------------------------------------------")
                self.downloadType = self.DOWNLOAD_TYPE.WAITTING
                self.console.execute( E2PrioFix( "sleep 2" ) )
                return DMHelper.STS.DOWNLOADING 
            else:
                return DMHelper.STS.DOWNLOADED
开发者ID:c0ns0le,项目名称:iptvplayer-for-e2-fork,代码行数:62,代码来源:m3u8downloader.py

示例4: start

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
    def start(self, url, filePath, params = {}, info_from=None, retries=0):
        '''
            Owervrite start from BaseDownloader
        '''
        self.url              = url
        self.filePath         = filePath
        self.downloaderParams = params
        self.fileExtension    = '' # should be implemented in future
        
        self.outData = ''
        self.contentType = 'unknown'
        if None == info_from:
            info_from = WgetDownloader.INFO.FROM_FILE
        self.infoFrom    = info_from
        
        if self.infoFrom == WgetDownloader.INFO.FROM_DOTS:
            info = "--progress=dot:default"
        else: info = ""
        
        cmd = DMHelper.getBaseWgetCmd(self.downloaderParams) + (' %s -t %d ' % (info, retries)) + '"' + self.url + '" -O "' + self.filePath + '" > /dev/null'
        printDBG("Download 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.wgetStatus = self.WGET_STS.CONNECTING
        self.status     = DMHelper.STS.DOWNLOADING
        
        self.onStart()
        return BaseDownloader.CODE_OK
开发者ID:a4tech,项目名称:iptvplayer-for-e2,代码行数:34,代码来源:wgetdownloader.py

示例5: goGetEpisodeType

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
 def goGetEpisodeType(self, privateData):
     url  = "'http://www.imdb.com/title/tt{0}/episodes/_ajax?season={1}'".format(privateData['id'], privateData['season'])
     grep =  '?ref_=ttep_ep{0}"'.format(privateData['episode'])
     grep = " | grep '{0}'".format(grep)
     cmd  = DMHelper.getBaseWgetCmd({}) + url + ' -O - 2>/dev/null ' + grep
     printDBG('doGetEpisodes cmd[%s]' % cmd)
     self.iptv_sys = iptv_system(cmd, self._goGetEpisodeTypeCallback)
开发者ID:c0ns0le,项目名称:iptvplayer-for-e2-fork,代码行数:9,代码来源:opensubtitlesorg.py

示例6: start

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
    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( cmd )
        
        self.status     = DMHelper.STS.DOWNLOADING
        
        self.onStart()
        return BaseDownloader.CODE_OK
开发者ID:samsamsam-iptvplayer,项目名称:iptvplayer-for-e2,代码行数:33,代码来源:f4mdownloader.py

示例7: _doSearchMovieNapisy24

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
 def _doSearchMovieNapisy24(self):
     params = {'User-Agent': self.NAPISY24_USER_AGENT, 'Referer':'http://napisy24.pl/'}
     query = 'title={0}'.format(urllib.quote(self.tmpData['title']))
     url     = "'http://napisy24.pl/libs/webapi.php?{0}'".format(query)
     cmd = DMHelper.getBaseWgetCmd(params) + url + ' -O - 2> /dev/null '
     printDBG('_doSearchMovieNapisy24 cmd[%s]' % cmd)
     self.iptv_sys = iptv_system(cmd, self._doSearchMovieNapisy24Callback)
开发者ID:c0ns0le,项目名称:iptvplayer-for-e2-fork,代码行数:9,代码来源:opensubtitlesorg.py

示例8: _doSearchMovieNapisy24

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
 def _doSearchMovieNapisy24(self):
     params = {"User-Agent": self.NAPISY24_USER_AGENT, "Referer": "http://napisy24.pl/"}
     query = "title={0}".format(urllib.quote(self.tmpData["title"]))
     url = "'http://napisy24.pl/libs/webapi.php?{0}'".format(query)
     cmd = DMHelper.getBaseWgetCmd(params) + url + " -O - 2> /dev/null "
     printDBG("_doSearchMovieNapisy24 cmd[%s]" % cmd)
     self.iptv_sys = iptv_system(cmd, self._doSearchMovieNapisy24Callback)
开发者ID:a4tech,项目名称:iptvplayer-for-e2,代码行数:9,代码来源:opensubtitlesorg.py

示例9: doGetItemTypeOLD

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
 def doGetItemTypeOLD(self, callback, privateData):
     self.outerCallback = callback
     self.tmpData = {}
     self.itemTypeCache = {"type": "movie"}
     url = "'http://www.omdbapi.com/?i=tt{0}&plot=short&r=json'".format(privateData["id"])
     cmd = DMHelper.getBaseWgetCmd({}) + url + " -O - 2> /dev/null "
     printDBG("doGetItemType cmd[%s]" % cmd)
     self.iptv_sys = iptv_system(cmd, self._doGetItemTypeCallback)
开发者ID:a4tech,项目名称:iptvplayer-for-e2,代码行数:10,代码来源:opensubtitlesorg.py

示例10: doGetItemType

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
 def doGetItemType(self, callback, privateData):
     self.outerCallback = callback
     self.tmpData = {'imdbid':privateData['id'], 'title':privateData['title']}
     self.itemTypeCache = {'type':'movie'}        
     url     = "'https://api.themoviedb.org/3/find/tt{0}?api_key={1}&external_source=imdb_id'".format(privateData['id'], base64.b64decode('NjMxMWY4MmQ1MjAxNDI2NWQ3NjVkMzk4MDJhYWZhYTc='))
     #printDBG(url)
     cmd = DMHelper.getBaseWgetCmd({}) + url + ' -O - 2> /dev/null '
     self.iptv_sys = iptv_system(cmd, self._doGetItemTypeCallback)
开发者ID:c0ns0le,项目名称:iptvplayer-for-e2-fork,代码行数:10,代码来源:opensubtitlesorg.py

示例11: doGetItemType

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
 def doGetItemType(self, callback, privateData):
     self.outerCallback = callback
     self.tmpData = {}
     self.itemTypeCache = {"type": "movie"}
     url = "'https://api.themoviedb.org/3/find/tt{0}?api_key={1}&external_source=imdb_id'".format(
         privateData["id"], base64.b64decode("NjMxMWY4MmQ1MjAxNDI2NWQ3NjVkMzk4MDJhYWZhYTc=")
     )
     cmd = DMHelper.getBaseWgetCmd({}) + url + " -O - 2> /dev/null "
     self.iptv_sys = iptv_system(cmd, self._doGetItemTypeCallback)
开发者ID:a4tech,项目名称:iptvplayer-for-e2,代码行数:11,代码来源:opensubtitlesorg.py

示例12: _getPage

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
    def _getPage(self, callback, url, params={}, post_data=None):
        if 'User-Agent' not in params: params['User-Agent'] =OpenSubOrgProvider.USER_AGENT
        
        if None != post_data:
            post_data = " --post-data '{0}' ".format(post_data)
        else: post_data = ''
            
        url = " '{0}' ".format(url)
        cmd = DMHelper.getBaseWgetCmd(params) + post_data + url + ' -O - 2> /dev/null'

        self.iptv_sys = iptv_system(cmd, callback)
开发者ID:c0ns0le,项目名称:iptvplayer-for-e2-fork,代码行数:13,代码来源:opensubtitlesorg.py

示例13: _doSearchSubtitleNapisy24

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
    def _doSearchSubtitleNapisy24(self, type="imdb"):
        self.tmpData["type"] = type
        params = {"User-Agent": self.NAPISY24_USER_AGENT, "Referer": "http://napisy24.pl/"}

        if type == "imdb":
            query = "imdb=tt{0}".format(self.tmpData["imdbid"])
        else:
            query = "title={0}".format(urllib.quote(self.tmpData["title"]))

        url = "'http://napisy24.pl/libs/webapi.php?{0}'".format(query)
        cmd = DMHelper.getBaseWgetCmd(params) + url + " -O - 2> /dev/null "
        printDBG("_doSearchSubtitleNapisy24Callback cmd[%s]" % cmd)
        self.iptv_sys = iptv_system(cmd, self._doSearchSubtitleNapisy24Callback)
开发者ID:a4tech,项目名称:iptvplayer-for-e2,代码行数:15,代码来源:opensubtitlesorg.py

示例14: _startM3U8

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
 def _startM3U8(self, m3u8Url):
     self.m3u8Url = m3u8Url
     self.outData = ''
     ##############################################################################
     # frist download m3u8 conntent
     ##############################################################################
     self.downloadType = self.DOWNLOAD_TYPE.M3U8
     m3u8Url = self._addTimeStampToUrl( self.m3u8Url )
     cmd = DMHelper.getBaseWgetCmd(self.downloaderParams) + (' --tries=0 --timeout=%d ' % self._getTimeout()) + '"' + m3u8Url + '" -O - 2> /dev/null'
     printDBG("Download cmd[%s]" % cmd)
     self.console_appClosed_conn = eConnectCallback(self.console.appClosed,  self._cmdFinished )
     self.console_stdoutAvail_conn = eConnectCallback(self.console.stdoutAvail, self._dataAvail )
     self.console.execute( E2PrioFix( cmd ) )
开发者ID:friman,项目名称:iptvplayer-for-e2-1,代码行数:15,代码来源:m3u8downloader.py

示例15: _doSearchSubtitleNapisy24

# 需要导入模块: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh import DMHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper import getBaseWgetCmd [as 别名]
 def _doSearchSubtitleNapisy24(self, type='imdb'):
     self.tmpData['type'] = type
     params = {'User-Agent': self.NAPISY24_USER_AGENT, 'Referer':'http://napisy24.pl/'}
     
     if type == 'imdb':
         query = 'imdb=tt{0}'.format(self.tmpData['imdbid'])
     else:
         query = 'title={0}'.format(urllib.quote(self.tmpData['title']))
     
     url     = "'http://napisy24.pl/libs/webapi.php?{0}'".format(query)
     cmd = DMHelper.getBaseWgetCmd(params) + url + ' -O - 2> /dev/null '
     printDBG('_doSearchSubtitleNapisy24Callback cmd[%s]' % cmd)
     self.iptv_sys = iptv_system(cmd, self._doSearchSubtitleNapisy24Callback)
开发者ID:c0ns0le,项目名称:iptvplayer-for-e2-fork,代码行数:15,代码来源:opensubtitlesorg.py


注:本文中的Plugins.Extensions.IPTVPlayer.iptvdm.iptvdh.DMHelper.getBaseWgetCmd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。