# -*- coding: utf-8 -*- import time import os import json import httpx class AgntTask: def __init__(self, cookies_list): self.cookies_list = cookies_list def daily_task(self): for cookies in self.cookies_list: url = "https://hub-api.agnthub.ai/api/daily-rewards/claim" headers = { "accept": "application/json, text/plain, */*", "accept-encoding": "gzip, deflate, br, zstd", "accept-language": "zh-CN,zh;q=0.9", "content-length": "0", "cookie": cookies, "origin": "https://quests.agnthub.ai", "priority": "u=1, i", "referer": "https://quests.agnthub.ai/", "sec-ch-ua": '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"', "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": '"Windows"', "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-site", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" } try: response = httpx.post(url, headers=headers) print(response.json()) except Exception as e: print(str(e)) def upload_task(self): for cookies in self.cookies_list: url = "https://hub-api.agnthub.ai/api/tasks/make-ai-laugh/34ecad1e-94df-48ba-b5f4-242fdd9d6546" headers = { "accept": "application/json, text/plain, */*", "accept-encoding": "gzip, deflate, br, zstd", "accept-language": "zh-CN,zh;q=0.9", "content-length": "0", "cookie": cookies, "origin": "https://quests.agnthub.ai", "priority": "u=1, i", "referer": "https://quests.agnthub.ai/", "sec-ch-ua": '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"', "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": '"Windows"', "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-site", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" } try: response = httpx.post(url, headers=headers) print(response.json()) except Exception as e: print(str(e)) def tasks(self): tasks_list = [ "6813de78-f821-4a84-8e8c-3aa89c15b2aa", "fce2e806-a6c7-4de2-abc2-260d13bcfb2f", "0bcb7d19-7c63-4933-96b0-00141ce54dbe", "2f3241c5-29a0-4f47-acf3-9370baf94e74", "d2b35062-40c1-48b8-bca5-c48779ccc66d", "ab2fd158-b894-47bc-aadb-645259b46cc0", "3861cd8e-5393-4285-b6ee-29a5ee301ee5", "1a75844a-a108-4fbd-bfc3-c7476b26b73d", "217e2f67-c110-4ef7-a636-8ac0623df3e8", "49c1db40-8ecf-4454-af0a-fcc81b222135", "2e6ff98c-132b-4886-8f38-6c89d1a7b02a", "9fc278e8-4045-4130-9f52-6ce3b713318c", "4f913da3-58b6-4636-a2c2-912fb01c73d4", "6216f4e1-eafb-4442-a5d4-5b1830f89655", "ebbba0a4-96d9-4fa4-85f9-6fb07fbc282a", "5172f361-d28e-4aa2-a3ba-2adfe5057539", "f81146e9-9ef9-4979-b0a0-437ea5c3e1bb", "22301ec3-3a75-4758-a886-ab768312ffe5", "6debaef3-844e-40f3-be6d-d99a6fd9f2a1", "932d0c29-22ad-4be5-92b4-fc3a2e13aaed", "05027b13-88a3-42a4-992a-0ce2a53068d4", "9e0addfa-51fd-4f3b-a6f2-8dbe301265aa", "4a42ba64-7822-469c-8899-bc07b5dd5d69", "516d941e-b006-4744-a190-6c3207750854", "bf9e7362-5eed-4110-bbe3-1289722a36b3", "7eed7668-e71a-42ed-98ac-a0ded8bc0296", "2cac41ba-36dd-4389-91b6-f8ee840083db", "6f888d49-2b59-4ba9-a7be-199dceff45ab" ] for cookies in cookies_list: for tasks in tasks_list: url = "https://hub-api.agnthub.ai/api/tasks/start/" + tasks headers = { "Accept": "application/json, text/plain, */*", "Accept-Encoding": "gzip, deflate, br, zstd", "Accept-Language": "zh-CN,zh;q=0.9", "Content-Length": "0", "Cookie": cookies, "Origin": "https://quests.agnthub.ai", "Priority": "u=1, i", "Referer": "https://quests.agnthub.ai/", "Sec-CH-UA": '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"', "Sec-CH-UA-Mobile": "?0", "Sec-CH-UA-Platform": '"Windows"', "Sec-Fetch-Dest": "empty", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "same-site", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" } for retry in range(1, 4): try: response = httpx.post(url, headers=headers) if response.status_code == 201: print("请求成功!") print(response.json()) break else: print(f"请求失败,状态码:{response.status_code}") print(response.text) except Exception as e: print(f"出现错误:{e}\n重试...") time.sleep(0.5) if __name__ == '__main__': config_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "config.json") try: with open(config_path, "r", encoding="utf-8") as file: config_data = json.load(file) except Exception as e: print(f"读取配置失败:{e}") exit(1) cookies_list = config_data.get("cookies", []) A = AgntTask(cookies_list) A.daily_task() A.upload_task() A.tasks()