cc123685 2021-06-22 19:52 采纳率: 0%
浏览 69

输出推送不到server酱上

import requests

SCKEY = '666'
url2 = 'https://api.tokyo.biliob233.com/user/check-in'
cookie2 = 666'


def it():
    headers = {
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36', 'cookie': cookie2
    }
    res = requests.post(url=url2, headers=headers).text
    print(res)

    # 微信推送
    def pushWechat(desp, nowtime):
        ssckey = SCKEY
        send_url = 'https://sc.ftqq.com/' + ssckey + '.send'
        if '登录' in desp:
            params = {
                'text': 'WPS小程序签到失败提醒' + nowtime,
                'desp': desp
            }
        else:
            params = {
                'text': 'WPS小程序签到提醒' + nowtime,
                'desp': desp
            }
        requests.post(send_url, params=params)
        f = open('bilibiliob.txt', 'w+', encoding='utf-8')
        f.write(res)
        f.close()

        desp2 = 'bilibiliob.txt'
        desp = desp2.read()  # 读取数据
        pushWechat(desp, nowtime)
        return desp


def main_handler(event, context):
    return it()




if __name__ == '__main__':
    it()

{"code":-1,"msg":"已经签过到了"}

{"code":-1,"msg":"未登录"}

server酱http://sc.ftqq.com/

发送消息非常简单,只需要向以下URL发一个GET或者POST请求:

https://sc.ftqq.com/SCU178542T4c ... 760c9fdbc12e3f.send
接受两个参数:

text:消息标题,最长为256,必填。
desp:消息内容,最长64Kb,可空,支持MarkDown。
最简单的消息发送方式是通过浏览器,在地址栏输入以下URL,回车后即可发送:

https://sc.ftqq.com/SCU178542T4c ... dbc12e3f.send?text=主人服务器又挂掉啦~

 

  • 写回答

1条回答 默认 最新

  • GISer Liu 2023-02-09 16:00
    关注

    以下答案引用自GPT-3大模型,请合理使用:
    &desp=我的服务器挂掉了,请帮忙看看是不是网络问题

    评论

报告相同问题?

悬赏问题

  • ¥15 求帮我调试一下freefem代码
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图