Python——实现Windows桌面壁纸和bing背景的同步

目的

实现Windows桌面壁纸和bing背景的同步


如何实现

requests(获取url)

json(解析对象)

os.path(设置图片保存路径以及日志信息)

ctypes(设置Windows壁纸)


具体过程

API:https://api.iyk0.com/mryt/

{
   
   
    "code": 1,
    "msg": "获取成功!",
    "data": [
        {
   
   
            "title": "冬日里的科赫尔湖,德国巴伐利亚州 (© Reinhard Schmid/eStock Photo)",
            "imgurl": "https://cn.bing.com/th?id=OHR.LakeKochelsee_ZH-CN0004970986_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp",
            "time": "20220106"
        },
        {
   
   
            "title": "树干上的扁嘴山巨嘴鸟,厄瓜多尔 (© Tui De Roy/Minden Pictures)",
            "imgurl": "https://cn.bing.com/th?id=OHR.MountainToucan_ZH-CN9939482570_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp",
            "time": "20220105"
        },
        {
   
   
            "title": "安沙波利哥沙漠州立公园,美国加利福尼亚州 (© Tom Hogan/plainpicture)",
            "imgurl": "https://cn.bing.com/th?id=OHR.BorregoBadlands_ZH-CN9913349081_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp",
            "time": "20220104"
        },
        {
   
   
            "title": "汉密尔顿山顶的利克天文台,美国加利福尼亚州 (© Jeffrey Lewis/Tandem Stills + Motion)",
            "imgurl": "https://cn.bing.com/th?id=OHR.LickObservatory_ZH-CN9676762110_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp",
            "time": "20220103"
        },
        {
   
   
            "title": "雪后的布拉格,捷克共和国 (© benkrut/Getty Images)",
            "imgurl": "https://cn.bing.com/th?id=OHR.SnowyPrague_ZH-CN9794475183_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp",
            "time": "20220102"
        },
        {
   
   
            "title": "睡在海滩上的竖琴海豹,纽约长岛 (© Vicki Jauron, Babylon and Beyond Photography/Getty Images)",
            "imgurl": "https://cn.bing.com/th?id=OHR.JonesBeachHarpSeal_ZH-CN9584238333_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp",
            
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值