从 URL 下载文件或视频 (Python 3)
我尝试了不同的libs以从URL下载视频。但是,即使他们中的一个也没有起作用。 这是ı尝试的链接:https://td-cdn.pw/api.php?download=tikdown.org-42500282235.mp4
如果打开一次,它直接要求下载,不喜欢HTML视频。我想将此视频保存到本地文件夹。
如果你们帮助我很自豪:)(顺便说一句
ı tried diffrent libs to download video from url. But even one of them didnt worked.
Here is the link, that ı trying: https://td-cdn.pw/api.php?download=tikdown.org-42500282235.mp4
If it opened once, it directly asking to download, not like a html video. And ı want to save this video to local folder.
If you guys help me ı would be so proud :) (btw ım freaking ı try to solve it last 4 hours)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在Python中下载文件有两个步骤,因此该过程是独立的。我建议使用内置
请求
库。我们使用它来向服务器提出请求并获取内容。然后,我们将数据写入下一步。但这只是一个简单的例子。您可以实现其他功能,例如
try/catch
块,以捕获任何异常或在提出请求时使用自定义标头。There are two steps to getting file downloaded in Python so the process is os independant. I would recommend using inbuilt
requests
library. We use it to make requests to server and fetch content. Then we write the data into a file in next step.But this is just a simple example. You can implement other features like
try/catch
blocks to catch any exceptions or use custom headers while making requests.