我试图使用请求或urllib来搜索视频,但是一旦下载它就听起来没有声音,它比原来的要长一点:
# 1st code :
import requests
url = "https://link/to/the/video.mp4"
path = "c:/Users/MyProfile/Desktop/video1.mp4"
obj = requests.get(url)
with open(path, "wb") as out_file :
out_file.write(obj.content)
# 2nd code :
import urllib
urllib.request.urlretrieve(url, path)