利用云函数实现自动签到

DailyCheckIn可为b站、贴吧、爱奇艺等多个平台实现签到功能

项目地址:https://github.com/Sitoi/dailycheckin

准备

  • 阿里云/腾讯云账号
  • 签到脚本
  • 需要签到的平台cookie

配置

一、登录云函数控制台,创建服务

二、进入该服务的函数管理,创建函数

三、修改默认代码

from dailycheckin.main import checkin 
def handler(event, context): 
	checkin()

四、使用终端安装环境

pip3 install dailycheckin --upgrade -t .

五、新建一个名为config的文件夹

六、在config文件夹下新建config.json文件,将下列代码填入json文件

{
  "BARK_URL": "",
  "COOLPUSHEMAIL": true,
  "COOLPUSHQQ": true,
  "COOLPUSHSKEY": "",
  "COOLPUSHWX": true,
  "DINGTALK_ACCESS_TOKEN": "",
  "DINGTALK_SECRET": "",
  "FSKEY": "",
  "PUSHPLUS_TOKEN": "",
  "PUSHPLUS_TOPIC": "",
  "QMSG_KEY": "",
  "QMSG_TYPE": "",
  "QYWX_AGENTID": "",
  "QYWX_CORPID": "",
  "QYWX_CORPSECRET": "",
  "QYWX_KEY": "",
  "QYWX_MEDIA_ID": "",
  "QYWX_TOUSER": "",
  "SCKEY": "",
  "SENDKEY": "",
  "TG_API_HOST": "",
  "TG_BOT_TOKEN": "",
  "TG_PROXY": "",
  "TG_USER_ID": "",
  "MERGE_PUSH": "",
  "ACFUN": [
    {
      "password": "Sitoi",
      "phone": "18888xxxxxx"
    },
    {
      "password": "多账号 密码填写,请参考上面",
      "phone": "多账号 手机号填写,请参考上面"
    }
  ],
  "BAIDU": [
    {
      "data_url": "https://cdn.jsdelivr.net/gh/Sitoi/Sitoi.github.io/baidu_urls.txt",
      "submit_url": "http://data.zz.baidu.com/urls?site=https://sitoi.cn&token=xxxxxx",
      "times": 10
    },
    {
      "data_url": "多账号 data_url 链接地址,以实际获取为准",
      "submit_url": "多账号 submit_url 链接地址,以实际获取为准",
      "times": 10
    }
  ],
  "BILIBILI": [
    {
      "cookie": "_uuid=xxxxxx; rpdid=xxxxxx; LIVE_BUVID=xxxxxx; PVID=xxxxxx; blackside_state=xxxxxx; CURRENT_FNVAL=xxxxxx; buvid3=xxxxxx; fingerprint3=xxxxxx; fingerprint=xxxxxx; buivd_fp=xxxxxx; buvid_fp_plain=xxxxxx; DedeUserID=xxxxxx; DedeUserID__ckMd5=xxxxxx; SESSDATA=xxxxxx; bili_jct=xxxxxx; bsource=xxxxxx; finger=xxxxxx; fingerprint_s=xxxxxx;",
      "coin_num": 0,
      "coin_type": 1,
      "silver2coin": true
    },
    {
      "cookie": "多账号 cookie 填写,请参考上面,cookie 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)",
      "coin_num": 0,
      "coin_type": 1,
      "silver2coin": true
    }
  ],
  "CLOUD189": [
    {
      "password": "Sitoi",
      "phone": "18888xxxxxx"
    },
    {
      "password": "多账号 密码填写,请参考上面",
      "phone": "多账号 手机号填写,请参考上面"
    }
  ],
  "FMAPP": [
    {
      "blackbox": "eyJlcnJxxxxxx",
      "device_id": "xxxxxx-xxxx-xxxx-xxxx-xxxxxx",
      "fmversion": "xxxxxx",
      "os": "xxxxxx",
      "token": "xxxxxx.xxxxxx-xxxxxx-xxxxxx.xxxxxx-xxxxxx",
      "useragent": "xxxxxx"
    },
    {
      "blackbox": "多账号 blackbox 填写,请参考上面,blackbox 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)",
      "device_id": "多账号 device_id 填写,请参考上面,以实际获取为准",
      "fmversion": "多账号 fmVersion 填写,请参考上面,以实际获取为准",
      "os": "多账号 os 填写,请参考上面,以实际获取为准",
      "token": "多账号 token 填写,请参考上面,以实际获取为准",
      "useragent": "多账号 User-Agent 填写,请参考上面,以实际获取为准"
    }
  ],
  "IQIYI": [
    {
      "cookie": "__dfp=xxxxxx; QP0013=xxxxxx; QP0022=xxxxxx; QYABEX=xxxxxx; P00001=xxxxxx; P00002=xxxxxx; P00003=xxxxxx; P00007=xxxxxx; QC163=xxxxxx; QC175=xxxxxx; QC179=xxxxxx; QC170=xxxxxx; P00010=xxxxxx; P00PRU=xxxxxx; P01010=xxxxxx; QC173=xxxxxx; QC180=xxxxxx; P00004=xxxxxx; QP0030=xxxxxx; QC006=xxxxxx; QC007=xxxxxx; QC008=xxxxxx; QC010=xxxxxx; nu=xxxxxx; __uuid=xxxxxx; QC005=xxxxxx;"
    },
    {
      "cookie": "多账号 cookie 填写,请参考上面,cookie 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
    }
  ],
  "KGQQ": [
    {
      "cookie": "muid=xxxxxx; uid=xxxxxx; userlevel=xxxxxx; openid=xxxxxx; openkey=xxxxxx; opentype=xxxxxx; qrsig=xxxxxx; pgv_pvid=xxxxxx;"
    },
    {
      "cookie": "多账号 cookie 填写,请参考上面,cookie 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
    }
  ],
  "MIMOTION": [
    {
      "max_step": "20000",
      "min_step": "10000",
      "password": "Sitoi",
      "phone": "18888xxxxxx"
    },
    {
      "max_step": "多账号 最大步数填写,请参考上面",
      "min_step": "多账号 最小步数填写,请参考上面",
      "password": "多账号 密码填写,请参考上面",
      "phone": "多账号 手机号填写,请参考上面"
    }
  ],
  "TIEBA": [
    {
      "cookie": "BIDUPSID=xxxxxx; PSTM=xxxxxx; BAIDUID=xxxxxx; BAIDUID_BFESS=xxxxxx; delPer=xxxxxx; PSINO=xxxxxx; H_PS_PSSID=xxxxxx; BA_HECTOR=xxxxxx; BDORZ=xxxxxx; TIEBA_USERTYPE=xxxxxx; st_key_id=xxxxxx; BDUSS=xxxxxx; BDUSS_BFESS=xxxxxx; STOKEN=xxxxxx; TIEBAUID=xxxxxx; ab_sr=xxxxxx; st_data=xxxxxx; st_sign=xxxxxx;"
    },
    {
      "cookie": "多账号 cookie 填写,请参考上面,cookie 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
    }
  ],
  "V2EX": [
    {
      "cookie": "_ga=xxxxxx; __cfduid=xxxxxx; PB3_SESSION=xxxxxx; A2=xxxxxx; V2EXSETTINGS=xxxxxx; V2EX_REFERRER=xxxxxx; V2EX_LANG=xxxxxx; _gid=xxxxxx; V2EX_TAB=xxxxxx;",
      "proxy": "使用代理的信息,无密码例子: http://127.0.0.1:1080 有密码例子: http://username:password@127.0.0.1:1080"
    },
    {
      "cookie": "多账号 cookie 填写,请参考上面,cookie 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)",
      "proxy": "使用代理的信息,无密码例子: http://127.0.0.1:1080 有密码例子: http://username:password@127.0.0.1:1080"
    }
  ],
  "YOUDAO": [
    {
      "cookie": "JSESSIONID=xxxxxx; __yadk_uid=xxxxxx; OUTFOX_SEARCH_USER_ID_NCOO=xxxxxx; YNOTE_SESS=xxxxxx; YNOTE_PERS=xxxxxx; YNOTE_LOGIN=xxxxxx; YNOTE_CSTK=xxxxxx; _ga=xxxxxx; _gid=xxxxxx; _gat=xxxxxx; PUBLIC_SHARE_18a9dde3de846b6a69e24431764270c4=xxxxxx;"
    },
    {
      "cookie": "多账号 cookie 填写,请参考上面,cookie 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
    }
  ]
}

七、获取cookie


1、登录需要签到的平台
2、按F12打开开发者工具,刷新
3、选择Network-Doc-需要签到的平台网址
4、复制cookie,填入json文件

如需微信推送,可使用server酱,登录https://sct.ftqq.com/,获取sendkey,填入json文件即可

八、设置定时任务

九、部署代码并测试


等待测试通过后,大功告成!