import requests
import datetime
url = 'http://ugcws.video.gtimg.com/uwMRJfz-r5jAYaQXGdGnC2_ppdhgmrDlPaRvaV7F2Ic/x0722fsp55q.p709.1.mp4?sdtfrom=v3010&platform=2&vkey=636985D23F9CB771164B9FCEF112F0D01D39A80B3F6F20EE4F7F3D9F8E11F507C5422A23EF4F597E297D2149840E571888B054571454F5B8F16766A2340BBF082C20BA14D96091A17D7AA8667EA4985929EF49C604FD061387F205FCD010C274'
# 请求要下载的url地址
html = requests.get(url)
# content返回的是bytes型也就是二进制的数据。
html = html.content
start_time = datetime.datetime.now()
print('开始输出时间{}'.format(start_time))
print(html)
start_down_time = datetime.datetime.now()
print('开始下载时间{}'.format(start_down_time))
with open('./shipin.mp4','wb') as f:
f.write(html)
end_time = datetime.datetime.now()
print('下载结束时间{}'.format(end_time))
网友评论