利用requests包下载音频文件

很简单,直接上代码。

    mp3_url="https://static.dedic.cn/archive/audio/e2/e27a4e2d-f7dc-442a-937e-6b10691275e5/data/95abd3e5-7114-424f-ba59-af59e8bc6538.mp3?stamp=1446545659992"
    req = requests.get(mp3_url)
    save_path = "./audios/" + id + ".mp3"
    with open(save_path, 'wb') as code:
        code.write(req.content)

你可能感兴趣的:(利用requests包下载音频文件)