侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

网宿cdn api 刷新缓存函数

2023-12-22 星期五 / 0 评论 / 0 点赞 / 150 阅读 / 1034 字

import hashlib,requests def wangsu_cdn_flush(user,password,purge): Headers = {"Content-Type": "appl

import hashlib,requests

def wangsu_cdn_flush(user,password,purge):
    Headers = {"Content-Type": "application/x-www-form-urlencoded",
                   "Connection": "Keep-Alive"}
    sign = hashlib.md5(user+password+purge).hexdigest()
    Data = "username=%s&passwd=%s&url=%s" %(user,sign,purge)
    response = requests.post('http://wscp.lxdns.com:8080/wsCP/servlet/contReceiver?',data=Data,headers=Headers)
    return response.text

if __name__ == "__main__":

    PURGE = 'http://xxx/static/images/Vnew/i4.jpg; http://xxx/static/images/Vnew/gsl_001.png;'

    user='xxxx'
    password='xxx'
    wangsu_flush(user,password,PURGE)

执行返回:

success append purge tasks... 刷新成功

广告 广告

评论区