engine.py 文件源码

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

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

        localFiles = []


        #workaround for this issue: https://github.com/xbmc/xbmc/pull/8531
        if xbmcvfs.exists(cachePath) or os.path.exists(cachePath):
            dirs,files = xbmcvfs.listdir(cachePath)
            for dir in dirs:
                subdir,subfiles = xbmcvfs.listdir(str(cachePath) + '/' + str(dir))
                for file in subfiles:
                    if bool(re.search('\.stream\.mp4', file)):
                        try:
                            nameFile = xbmcvfs.File(str(cachePath) + '/' + str(dir) + '/' + str(dir) + '.name')
                            filename = nameFile.read()
                            nameFile.close()
                        except:
                            filename = file
                        try:
                            nameFile = xbmcvfs.File(str(cachePath) + '/' + str(dir) + '/' + str(os.path.splitext(file)[0]) + '.resolution')
                            resolution = nameFile.read()
                            nameFile.close()
                        except:
                            resolution = file
                        offlineFile = offlinefile.offlinefile(filename, str(cachePath) + '/' + str(dir) +'.jpg', resolution.rstrip(), str(cachePath) + '/' + str(dir) + '/' + str(os.path.splitext(file)[0]) + '.mp4')
                        localFiles.append(offlineFile)

        return localFiles


    ##
    # Add a media file to a directory listing screen
    #   parameters: package, context type, whether file is encfs, encfs:decryption path, encfs:encryption path
    ##
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号