【青龙脚本】飞客茶馆签到

2024/03/21 需自行添加到青龙面板里面

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
File: flytea.py
Author: 乔大侠来了
Date: 2023/9/8 10:50
cron: 0 45 6 * * ?
new Env('飞客茶馆');
Description: 飞客茶馆,每日签到
Update: 2023/9/8 自行添加环境变量FLYTEA_COOKIE
"""
import os
import logging
import sys
import requests
import notify
import re

# 通知内容
message = []


def main():
    cookies = ""
    if cookies == "":
        if os.environ.get("FLYTEA_COOKIE"):
            cookies = os.environ.get("FLYTEA_COOKIE")
        else:
            logging.info("😢请在环境变量填写FLYTEA_COOKIE的值")
            message.append("😢请在环境变量填写FLYTEA_COOKIE的值")
            sys.exit()
    for idx, cookie in enumerate(cookies.split("&")):
        url = 'https://www.flyert.com/plugin.php?id=k_misign:sign&operation=qiandao&formhash=0b11b546&from=insign&is_ajax=1&infloat=yes&handlekey=qiandao&inajax=1&ajaxtarget=fwin_content_qiandao'
        header = {
            'authority':'www.flyert.com',
            'method':'GET',
            'path':'/plugin.php?id=k_misign:sign&operation=qiandao&formhash=0b11b546&from=insign&is_ajax=1&infloat=yes&handlekey=qiandao&inajax=1&ajaxtarget=fwin_content_qiandao',
            'scheme':'https',
            'Accept': '*/*',
            'Accept-Encoding': 'utf-8',
            'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
            'Cookie': cookie,
            'Referer': 'https://www.flyert.com/forum.php?mod=forumdisplay&fid=319',
            'Sec-Fetch-Dest': 'empty',
            'Sec-Fetch-Mode': 'cors',
            'Sec-Fetch-Site': 'same-origin',
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
            'X-Requested-With': 'XMLHttpRequest'
        }
        respo = requests.get(url=url, headers=header).text
        #print(respo)
        pai1 = re.findall('签到成功', respo)
        #print(pai1)
        pai2 = re.findall('每天只能签到一次', respo)
        #print(pai2)

        if not pai1:
            if not pai2:
                message.append(f"😢第{idx+1}个账号,签到失败")
                return "签到失败"
            else :
                message.append(f"😢第{idx+1}个账号,已签到")
                return "已签到"           
        else:
            message.append(f"😊第{idx+1}个账号,签到成功")
            return "签到成功"



if __name__ == '__main__':
    # 初始化日志系统
    main()
    # 发送通知
    msg = '\n'.join(message)
    notify.send("飞客茶馆", msg)

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值