downloader.py 文件源码

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

项目:skymod 作者: DelusionalLogic 项目源码 文件源码
def fetch_file(self, uri, filename):
        print("Fetching {}".format(filename))
        # Is the uri cached
        if uri in self.cache:
            tqdm.write("{} found in cache".format(uri))
            return (self.cache.get(uri) / "file", filename)

        with self.cache.atomic_add(uri) as dl_cache:
            for handler in self.handlers:
                if handler.accept(uri):
                    handler.fetch(uri, dl_cache / "file")

        return (self.cache.get(uri) / "file", filename)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号