cache.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Python-GoogleDrive-VideoStream 作者: ddurdle 项目源码 文件源码
def setCC(self, service):

        if not constants.CONST.CC:
            return

        #load cachePath if not already loaded
        if self.cachePath == '':
            self.cachePath = service.settings.cachePath

        # there is no cache path setting or the setting is unset -- we should assume user does not want to use caching
        # CC files need to be cached (so they can be converted to SRT) -- don't do anything if we don't have the cachePath
        if self.cachePath == '':
            return

        else:
            cachePath = str(self.cachePath) + '/' + str(self.package.file.id)+'/'
            if not xbmcvfs.exists(cachePath):
                xbmcvfs.mkdirs(cachePath)
            cachePath = str(cachePath) + str(self.package.file.id)
            cc = service.getTTS(self.package.file.srtURL)
            if cc:
                for file in cc:
                    if not xbmcvfs.exists(cachePath + str(file[0])):
                        service.downloadTTS(file[1], str(cachePath) + str(file[0]))
                    self.srt.append(str(cachePath) + str(file[0]))

    ##
    #  fetch the SRT
    ##
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号