Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -55,4 +70,6 @@ workflows:
- v2ex:
context: checkincontext
- onepoint3acres:
context: checkincontext
- deepflood:
context: checkincontext
3 changes: 2 additions & 1 deletion .github/workflows/deploy-circleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
store_secret "TWOCAPTCHA_APIKEY" "${{ secrets.TWOCAPTCHA_APIKEY }}"
store_secret "DEEPFLOOD_COOKIE" "${{ secrets.DEEPFLOOD_COOKIE }}"
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

- **Nodeseek**
- 自动签到
- **Deepflood**
- 自动签到
- **V2EX**
- 自动签到
- **一亩三分地**
Expand Down Expand Up @@ -117,10 +119,10 @@ https://github.com/timerring/CloudCheckin/blob/0b719258ab4f5f746b067798eb2a4185a
#### 配置签到平台

<details>
<summary>配置 Nodeseek 签到</summary>
<summary>配置 Nodeseek/Deepflood 签到</summary>

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`
</details>


Expand Down Expand Up @@ -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
```
Expand Down
Empty file added deepflood/__init__.py
Empty file.
65 changes: 65 additions & 0 deletions deepflood/deepflood.py
Original file line number Diff line number Diff line change
@@ -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)