CCCAT签到脚本

CCCAT是个不错的公益机场emmm,不过流量得要自己签到。像签到这种事情嘛,很自然地应该交给机器去做啦!

Python脚本如下:

import requests

base_url = 'https://cccat.io'


def checkin():
    email = 'YOUR EMAIL ADDRESS'
    password = 'YOUR PASSWORD'

    email = email.split('@')
    email = email[0] + '%40' + email[1]

    session = requests.session()
    login_url = base_url + '/user/_login.php'
    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
        'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    }
    post_data = 'email=' + email + '&passwd=' + password + '&code=&remember_me=week'
    post_data = post_data.encode()
    response = session.post(login_url, post_data, headers=headers, verify=False)

    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
        'Referer': base_url + '/user'
    }

    response = session.post(base_url + '/user/_checkin.php', headers=headers)

checkin()

食用方法:保存该脚本,修改邮箱密码参数,然后加入cron并用python运行之~
0 20 * * * /usr/bin/python3 THE PATH OF THE SCRIPT

标签: none

添加新评论