当前位置:网站首页>可下载视频可下载图片的函数
可下载视频可下载图片的函数
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
边栏推荐
- 自然语言处理相关list
- Remote file xxx is mapped to the local path xxx and can‘t be found. You can continue debugging....
- 【Rhapsody学习笔记】3:Dishwasher
- Multi-Modal Face Anti-Spoofing Based on Central Difference Networks学习笔记
- 2021年软件测试面试题大全
- Virtual machine view port number process
- 变分自编码器VAE实现MNIST数据集生成by Pytorch
- Tensorflow related list
- pyspark.ml特征变换模块
- opencv之访问图像像素的三种方法
猜你喜欢

np.fliplr与np.flipud

Chemical Reagent Phospholipid-Polyethylene Glycol-Amino, DSPE-PEG-amine, CAS: 474922-26-4

crontab的定时操作

random.randint函数用法

pyspark.ml特征变换模块

DingTalk Enterprise Internal-H5 Micro Application Development

2021-09-30

Learning and understanding of ROS service programming

拒绝采样小记

DSPE-PEG-Biotin,CAS:385437-57-0,磷脂-聚乙二醇-生物素可延长循环半衰期
随机推荐
CAS:474922-22-0 Maleimide-PEG-DSPE Phospholipid-Polyethylene Glycol-Maleimide Brief Description
超参数优化-摘抄
Multi-Modal Face Anti-Spoofing Based on Central Difference Networks学习笔记
Pytorch Daily Practice - Predicting Surviving Passengers on the Titanic
Natural language processing related list
2022年SQL大厂高频实战面试题(详细解析)
Cholesterol-PEG-Azide CLS-PEG-N3 胆固醇-聚乙二醇-叠氮 MW:3400
ROS之service编程的学习和理解
2022 SQL big factory high-frequency practical interview questions (detailed analysis)
Pytorch常用函数
Pytorch每日一练——预测泰坦尼克号船上的生存乘客
Where can I find the private files set by myself?
DC-CDN学习笔记
【Rhapsody学习笔记】4:Relations
DSPE-PEG-Thiol DSPE-PEG-SH 磷脂-聚乙二醇-巯基脂质体制备用
DSPE-PEG-Azide DSPE-PED-N3 Phospholipid-Polyethylene Glycol-Azide Lipid PFG
钉钉企业内部-H5微应用开发
DSPE-PEG-Biotin, CAS: 385437-57-0, phospholipid-polyethylene glycol-biotin prolongs circulating half-life
IDEA概述和安装及调试
Phospholipids-Polyethylene Glycol-Active Esters for Scientific Research DSPE-PEG-NHS CAS: 1445723-73-8