download_subtitles.py 文件源码

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

项目:dopplerr 作者: Stibbons 项目源码 文件源码
def search_file(root_dir, base_name):
        # This won't work with python < 3.5
        found = []
        base_name = glob.escape(base_name)
        beforext, _, ext = base_name.rpartition('.')
        if ext.lower() in VIDEO_FILES_EXT:
            protected_path = os.path.join(root_dir, "**", "*" + beforext + "*" + ext)
        else:
            protected_path = os.path.join(root_dir, "**", "*" + beforext + "*")
        protected_path = protected_path
        log.debug("Searching %r", protected_path)
        for filename in glob.iglob(protected_path, recursive=True):
            log.debug("Found: %s", filename)
            found.append(filename)
        return found
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号