我需要从“https://www.thewatchcartoononline.tv/bobs-burgers-season-9-episode-5-live-and-let-fly”下载视频并播放。我可以下载为“汉堡.s09e03.mp4“但无法播放!你知道吗
import requests
import bs4
url = 'https://www.thewatchcartoononline.tv/bobs-burgers-season-9-episode-5-live-and-let-fly'
def download_file(url, filename):
r = requests.get(url, stream=True)
with open(filename, 'wb') as f:
for chunk in r.iter_content(chunk_size = 1024):
if chunk:
f.write(chunk)
return (filename)
download_file(url, "bobs.burgers.s09e03.mp4")
我觉得视频应该下载播放。你知道吗
在编写脚本下载网页之后,你不能指望有视频。您的代码下载网页并将其存储在.mp4文件中。以下代码表示作业正确。你知道吗
相关问题 更多 >
编程相关推荐