Downloader.py 文件源码

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

项目:HLTVDemoDownloader 作者: ReagentX 项目源码 文件源码
def download(demo_ids, threads):
    # Convert the DemoIDs to URLs
    urls = convert_to_urls(demo_ids)

    # Define the number of threads
    pool = ThreadPool(threads)

    # Make a folder for the event to save the files in
    directory = make_dir()

    # Calls get() and adds the filesize returned each call to an array called filesizes
    filesizes = pool.map(get, urls)
    pool.close()
    pool.join()

    # Create a float to store the filesizes in and add them together
    total_file_size = sum(filesizes)

    # Print the properly formatted filesize.
    print "Successfully transferred %s. Enjoy!" % (format_file_size(total_file_size))
    return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号