From 36aa076df256793b42bd515c9bbcd4134438cc85 Mon Sep 17 00:00:00 2001 From: John Howe <89397553+timerring@users.noreply.github.com> Date: Sat, 3 Jan 2026 01:30:23 +0800 Subject: [PATCH] feat: add deepflood --- .circleci/config.yml | 17 +++++++ .github/workflows/deploy-circleci.yml | 3 +- README.md | 9 ++-- deepflood/__init__.py | 0 deepflood/deepflood.py | 65 +++++++++++++++++++++++++++ 5 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 deepflood/__init__.py create mode 100644 deepflood/deepflood.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 9c2cbd9..b31410b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,6 +46,21 @@ jobs: command: | python -m onepoint3acres.onepoint3acres + deepflood: + docker: + - image: cimg/python:3.11 + steps: + - checkout + - run: + name: Install dependencies + command: | + python -m pip install --upgrade pip + pip install curl_cffi python-dotenv + - run: + name: Run Deepflood signin + command: | + python -m deepflood.deepflood + workflows: # Allow manual triggers manual_trigger: @@ -55,4 +70,6 @@ workflows: - v2ex: context: checkincontext - onepoint3acres: + context: checkincontext + - deepflood: context: checkincontext \ No newline at end of file diff --git a/.github/workflows/deploy-circleci.yml b/.github/workflows/deploy-circleci.yml index 009527b..db58080 100644 --- a/.github/workflows/deploy-circleci.yml +++ b/.github/workflows/deploy-circleci.yml @@ -56,4 +56,5 @@ jobs: store_secret "NODESEEK_COOKIE" "${{ secrets.NODESEEK_COOKIE }}" store_secret "V2EX_COOKIE" "${{ secrets.V2EX_COOKIE }}" store_secret "ONEPOINT3ACRES_COOKIE" "${{ secrets.ONEPOINT3ACRES_COOKIE }}" - store_secret "TWOCAPTCHA_APIKEY" "${{ secrets.TWOCAPTCHA_APIKEY }}" \ No newline at end of file + store_secret "TWOCAPTCHA_APIKEY" "${{ secrets.TWOCAPTCHA_APIKEY }}" + store_secret "DEEPFLOOD_COOKIE" "${{ secrets.DEEPFLOOD_COOKIE }}" \ No newline at end of file diff --git a/README.md b/README.md index eb6ae56..42956e8 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ - **Nodeseek** - 自动签到 +- **Deepflood** + - 自动签到 - **V2EX** - 自动签到 - **一亩三分地** @@ -117,10 +119,10 @@ https://github.com/timerring/CloudCheckin/blob/0b719258ab4f5f746b067798eb2a4185a #### 配置签到平台
-配置 Nodeseek 签到 +配置 Nodeseek/Deepflood 签到 -1. 从 Nodeseek 网站获取 `cookie`(获取方法请参考 [COOKIE 获取教程](https://blog.timerring.com/posts/the-way-to-get-cookie/)) -2. 将 `cookie` 添加到仓库密钥中,命名为 `NODESEEK_COOKIE` +1. 从 Nodeseek/Deepflood 网站获取 `cookie`(获取方法请参考 [COOKIE 获取教程](https://blog.timerring.com/posts/the-way-to-get-cookie/)) +2. 将 `cookie` 添加到仓库密钥中,命名为 `NODESEEK_COOKIE`/`DEEPFLOOD_COOKIE`
@@ -160,6 +162,7 @@ cp .env.localtest.example .env # 运行签到脚本 python -m nodeseek.nodeseek +python -m deepflood.deepflood python -m v2ex.v2ex python -m onepoint3acres.onepoint3acres ``` diff --git a/deepflood/__init__.py b/deepflood/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/deepflood/deepflood.py b/deepflood/deepflood.py new file mode 100644 index 0000000..5fb988b --- /dev/null +++ b/deepflood/deepflood.py @@ -0,0 +1,65 @@ +import sys +import os +from curl_cffi import requests +import random +import time +from dotenv import load_dotenv +from telegram.notify import send_tg_notification + +load_dotenv() + +# Get COOKIE from environment variable, multiple cookies separated by & +cookies = os.environ.get('DEEPFLOOD_COOKIE', '').strip() + +if not cookies: + raise ValueError("Environment variable DEEPFLOOD_COOKIE is not set") + sys.exit(1) + +# Split multiple cookies by & to form a list +cookie_list = cookies.split('&') + +# Request headers +headers = { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0', + 'Origin': 'https://www.deepflood.com', + 'Referer': 'https://www.deepflood.com/board', + 'Content-Type': 'application/json', +} + +# Iterate over multiple account cookies for check-in +for idx, cookie in enumerate(cookie_list): + + print(f"Using the {idx+1} account for check-in...", flush=True) + # Generate a random delay + random_delay = random.randint(1, 20) + print(f"The {idx+1} account will wait for {random_delay} seconds...", flush=True) + time.sleep(random_delay) + + # Add cookie to headers + headers['Cookie'] = cookie.strip() + + try: + # random=true means get a random bonus + url = 'https://www.deepflood.com/api/attendance?random=true' + response = requests.post(url, headers=headers, impersonate="chrome136") + + # Output the status code and response content + print(f"The {idx+1} account's Status Code: {response.status_code}", flush=True) + print(f"The {idx+1} account's Response Content: {response.text}", flush=True) + + # Check if the check-in is successful based on the response content + if response.status_code == 200: + success_message = f"DEEPFLOOD account {idx+1} check-in successful" + print(success_message, flush=True) + send_tg_notification(success_message) + else: + fail_message = f"DEEPFLOOD account {idx+1} check-in failed, response content: {response.text}" + print(fail_message, flush=True) + send_tg_notification(fail_message) + sys.exit(1) + + except Exception as e: + error_message = f"DEEPFLOOD account {idx+1} check-in process error: {e}" + print(error_message, flush=True) + send_tg_notification(error_message) + sys.exit(1)