|
3 | 3 | from curl_cffi import requests |
4 | 4 | import random |
5 | 5 | import time |
| 6 | +from dotenv import load_dotenv |
6 | 7 | from telegram.notify import send_tg_notification |
7 | 8 |
|
| 9 | +load_dotenv() |
| 10 | + |
8 | 11 | # Get COOKIE from environment variable, multiple cookies separated by & |
9 | | -cookies = os.environ.get('NODESEEK_COOKIE').strip() |
| 12 | +cookies = os.environ.get('NODESEEK_COOKIE', '').strip() |
10 | 13 |
|
11 | 14 | if not cookies: |
12 | 15 | raise ValueError("Environment variable NODESEEK_COOKIE is not set") |
|
17 | 20 |
|
18 | 21 | # Request headers |
19 | 22 | headers = { |
20 | | - 'Accept': '*/*', |
21 | | - 'Accept-Encoding': 'gzip, deflate, br, zstd', |
22 | | - 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8', |
23 | | - 'Content-Length': '0', |
| 23 | + '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', |
24 | 24 | 'Origin': 'https://www.nodeseek.com', |
25 | 25 | 'Referer': 'https://www.nodeseek.com/board', |
26 | | - 'Sec-CH-UA': '"Chromium";v="134", "Not:A-Brand";v="24", "Google Chrome";v="134"', |
27 | | - 'Sec-CH-UA-Mobile': '?0', |
28 | | - 'Sec-CH-UA-Platform': '"Windows"', |
29 | | - 'Sec-Fetch-Dest': 'empty', |
30 | | - 'Sec-Fetch-Mode': 'cors', |
31 | | - 'Sec-Fetch-Site': 'same-origin', |
32 | | - 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36', |
| 26 | + 'Content-Type': 'application/json', |
33 | 27 | } |
34 | 28 |
|
35 | 29 | # Iterate over multiple account cookies for check-in |
|
47 | 41 | try: |
48 | 42 | # random=true means get a random bonus |
49 | 43 | url = 'https://www.nodeseek.com/api/attendance?random=true' |
50 | | - response = requests.post(url, headers=headers, impersonate="chrome110") |
| 44 | + response = requests.post(url, headers=headers, impersonate="chrome124") |
51 | 45 |
|
52 | 46 | # Output the status code and response content |
53 | 47 | print(f"The {idx+1} account's Status Code: {response.status_code}", flush=True) |
|
0 commit comments