获取图片
import requests
res=requests.get('https://res.pandateacher.com/2019-01-12-15-29-33.png')
#res.encoding='wb'
#转换为二进制流
picture=res.content
#打开文件,保存
file1 = open('/home/aaa/Desktop/Python/picture.png','wb')
file1.write(picture)
#print(picture)
获取音频于图片类似
import requests
res=requests.get('https://static.pandateacher.com/Over%20The%20Rainbow.mp3')
#res.encoding='wb'
picture=res.content
file1 = open('/home/aaa/Desktop/Python/music.mp3','wb')
file1.write(picture)
#print(picture)