[Python] 纯文本查看 复制代码 import requests
from datetime import date
import os
# 获取当前日期
current_date = date.today()
date_str = f'D:/每日日报/{current_date}/' # 本地想要下载到的地址
if not os.path.exists(date_str):
# 创建输出目录
os.makedirs(date_str)
# 发起GET请求
image_data = requests.get('https://dayu.qqsuu.cn/moyuribao/apis.php')
with open(f'{date_str}{current_date}_摸鱼日报.jpg', 'wb') as f:
f.write(image_data.content)
# 发起GET请求
image_data = requests.get('https://dayu.qqsuu.cn/moyurili/apis.php')
with open(f'{date_str}{current_date}_摸鱼日历.jpg', 'wb') as f:
f.write(image_data.content)
# 发起GET请求
image_data = requests.get('https://dayu.qqsuu.cn/mingxingbagua/apis.php')
with open(f'{date_str}{current_date}_明星八卦.jpg', 'wb') as f:
f.write(image_data.content)
# 发起GET请求
image_data = requests.get('https://dayu.qqsuu.cn/neihanduanzi/apis.php')
with open(f'{date_str}{current_date}_内涵段子.jpg', 'wb') as f:
f.write(image_data.content)
# 发起GET请求
image_data = requests.get('https://dayu.qqsuu.cn/weiyujianbao/apis.php')
with open(f'{date_str}{current_date}_60s读世界.jpg', 'wb') as f:
f.write(image_data.content)
# 发起GET请求
image_data = requests.get('https://dayu.qqsuu.cn/qingganhuayuan/apis.php')
with open(f'{date_str}{current_date}_情感花园.jpg', 'wb') as f:
f.write(image_data.content)
# 发起GET请求
image_data = requests.get('https://dayu.qqsuu.cn/xingzuoyunshi/apis.php')
with open(f'{date_str}{current_date}_星座运势.jpg', 'wb') as f:
f.write(image_data.content)
# 发起GET请求
video_data = requests.get('https://dayu.qqsuu.cn/moyuribaoshipin/apis.php')
with open(f'{date_str}{current_date}_摸鱼日报美女视频版.mp4', 'wb') as f:
f.write(video_data.content)
铁汁们要用的话记得把保存地址更换成自己本地的地址哈。 |