当前位置:网站首页>可下载视频可下载图片的函数
可下载视频可下载图片的函数
2022-07-31 05:17:00 【'番茄炒蛋饭'】
可下载视频可下载图片的函数
可下载视频可下载图片
import requests
def download_video(url, path):
try:
r = requests.get(url, stream=True)
if r.status_code == 200:
with open(path, mode='wb') as f:
for chunk in r.iter_content(chunk_size=1024):
if chunk:
f.write(chunk)
print("download succeed")
# Debug.logger.debug(f"download succeed")
else:
print(f"接口没有返回参数==={
url}")
# Debug.logger.debug(f"接口没有返回参数==={url}")
except:
# Debug.logger.debug(f"download failed2 未知错误==={url}")
print(f"download failed2 未知错误==={
url}")
pass
if __name__ == '__main__':
url = "http://192.168.12.xxx/score/3.jpg"
path = r"1.jpg"
download_video(url, path)
pass
边栏推荐
猜你喜欢

DSPE-PEG-Biotin, CAS: 385437-57-0, phospholipid-polyethylene glycol-biotin prolongs circulating half-life

pyspark.ml特征变换模块

random.randint函数用法

mPEG-DSPE 178744-28-0 甲氧基-聚乙二醇-磷脂酰乙醇胺线性PEG磷脂

wangeditor编辑器内容传至后台服务器存储

Fluorescein-PEG-DSPE Phospholipid-Polyethylene Glycol-Fluorescein Fluorescent Phospholipid PEG Derivatives

ROS之service编程的学习和理解

crontab的定时操作

四种常见的POST提交数据方式

box-shadow相关属性
随机推荐
Tensorflow边用边踩坑
RuntimeError: CUDA error: no kernel image is available for execution on the device问题记录
[Solved] ssh connection report: Bad owner or permissions on C:\\Users/XXX/.ssh/config
CLS-PEG-FITC Fluorescein-PEG-CLS 胆固醇-聚乙二醇-荧光素简介
pytorch学习笔记10——卷积神经网络详解及mnist数据集多分类任务应用
Shell/Vim related list
2021-09-30
Hyperparameter Optimization - Excerpt
MySQL master-slave switching steps
DSPE-PEG-Azide DSPE-PED-N3 Phospholipid-Polyethylene Glycol-Azide Lipid PFG
Four common ways of POST to submit data
ROS之service编程的学习和理解
CAS:474922-22-0 Maleimide-PEG-DSPE Phospholipid-Polyethylene Glycol-Maleimide Brief Description
mPEG-DSPE 178744-28-0 Methoxy-polyethylene glycol-phosphatidylethanolamine linear PEG phospholipids
Detailed explanation of mysql transaction principle
Picture-in-Picture API in the browser
Cholesterol-PEG-Azide CLS-PEG-N3 胆固醇-聚乙二醇-叠氮 MW:3400
ROS 之订阅多个topic时间同步问题
CAS:474922-22-0 Maleimide-PEG-DSPE 磷脂-聚乙二醇-马来酰亚胺简述
Tensorflow steps on the pit while using it