@@ -84,7 +84,7 @@ def __init__(self, cookies, data, content0, content1, task_order, rest_times):
8484 self .task_order = task_order or []
8585 self .executed_tasks = [] # 用于跟踪已执行的任务
8686 self .rest_times = rest_times or {} # 存储休息时间配置
87- self .username = content1
87+ self .account = content1
8888 self .device_number = content0 # 设备号,可以从配置中获取
8989 self .machine_code = self .generate_machine_code () # 获取机器码
9090 self .is_phone = 0 # 是否是手机
@@ -277,13 +277,13 @@ async def execute_task_with_timeout(self, task_func, task_index, position, compl
277277 remaining_time = completion_time - elapsed_time
278278
279279 if remaining_time > 0 :
280- await self .robust_update_status (f"{ task_name } 提前完成,等待剩余时间 : { int (remaining_time )} 秒" )
280+ await self .robust_update_status (f"{ task_name } 提前完成,等待剩餘時間 : { int (remaining_time )} 秒" )
281281 # 更新倒计时显示为剩余等待时间
282282 if self .status_window and hasattr (self .status_window , 'update_task_countdown' ):
283283 asyncio .create_task (self .update_waiting_countdown (task_id , int (remaining_time )))
284284 await asyncio .sleep (remaining_time )
285285 else :
286- await self .robust_update_status (f"{ task_name } 在指定时间内完成 " )
286+ await self .robust_update_status (f"{ task_name } 在指定時間內完成 " )
287287
288288 except asyncio .TimeoutError :
289289 await self .robust_update_status (f"{ task_name } 執行超時,強制結束並進入下一個任務" )
@@ -477,7 +477,7 @@ async def home_post(self):
477477
478478 # 請求數據
479479 tweet = await self .fetch_data (
480- f"http://aj.ry188.vip/api/GetUrlList.aspx?Account={ self .username } " )
480+ f"http://aj.ry188.vip/api/GetUrlList.aspx?Account={ self .account } " )
481481 response_url = tweet .split ("|+|" )
482482 comment_text = response_url [7 ].split ("{}" )
483483
@@ -508,7 +508,7 @@ async def sponsor_like(self,selector,like_count,seek_count):
508508
509509 #請求數據
510510 tweet = await self .fetch_data (
511- f"http://aj.ry188.vip/api/GetUrlList.aspx?Account={ self .username } " )
511+ f"http://aj.ry188.vip/api/GetUrlList.aspx?Account={ self .account } " )
512512 response_url = tweet .split ("|+|" )
513513 comment_text = response_url [7 ].split ("{}" )
514514
@@ -644,7 +644,7 @@ async def comment_post(self, comment_text, posts):
644644 # """發文、推文"""
645645 async def tweet_comment (self ):
646646 await self .robust_update_status ("開始執行發文" )
647- tweet = await self .fetch_data (f"http://aj.ry188.vip/api/GetUrlList.aspx?Account={ self .username } &Count1={ self .Count1 } &Count2={ self .Count2 } " )
647+ tweet = await self .fetch_data (f"http://aj.ry188.vip/api/GetUrlList.aspx?Account={ self .account } &Count1={ self .Count1 } &Count2={ self .Count2 } " )
648648 response_url = tweet .split ("|+|" )
649649 post_url = response_url [0 ].split ("{}" )
650650 # 發文內容設置
@@ -705,7 +705,7 @@ async def post_comment(self):
705705 await self .robust_update_status (f"開始執行推文" )
706706 asyncio .create_task (self .report_task_status (f"開始執行推文" ))
707707 post = await self .fetch_data (
708- f"http://aj.ry188.vip/api/GetPostUrlList.aspx?Account={ self .username } &UrlCount={ self .Count_num } &Count1={ self .Count1 } &Count2={ self .Count2 } " )
708+ f"http://aj.ry188.vip/api/GetPostUrlList.aspx?Account={ self .account } &UrlCount={ self .Count_num } &Count1={ self .Count1 } &Count2={ self .Count2 } " )
709709 response_url = post .split ("|+|" )
710710 post_url = response_url [0 ].split ("{}" )
711711 print (post_url ) # 推文留言網址
@@ -728,7 +728,7 @@ async def post_comment(self):
728728 # 加社團up
729729 async def add_join_groups (self ):
730730 groups = await self .fetch_data2 (
731- f"http://aj.ry188.vip/api/GetGroupUrl.aspx?Account={ self .username } " )
731+ f"http://aj.ry188.vip/api/GetGroupUrl.aspx?Account={ self .account } " )
732732 is_on_line = parse_bool (groups ["IsOnLineGroupData" ])#是否在線社團
733733 answer = ["遵守版規" , "同意版規" , "感謝版主" ]
734734 for i in range (len (groups ["GroupDataList" ])):
@@ -958,7 +958,7 @@ async def add_friend_invitation(self):
958958
959959 async def post_personal_updates (self ):
960960 tweet = await self .fetch_data (
961- f"http://aj.ry188.vip/api/GetUrlList.aspx?Account={ self .username } &Count1={ self .Count1 } &Count2={ self .Count2 } " )
961+ f"http://aj.ry188.vip/api/GetUrlList.aspx?Account={ self .account } &Count1={ self .Count1 } &Count2={ self .Count2 } " )
962962 response_url = tweet .split ("|+|" )
963963 await self .page .goto (url = "https://www.facebook.com/" , wait_until = 'load' ,timeout = 50000 )
964964 title = await self .page .title ()
@@ -1103,7 +1103,7 @@ async def report_add_join_groups(self, task_name):
11031103 encoded_bytes = base64 .b64encode (task_name .encode ('utf-8' ))
11041104 encoded_task_name = encoded_bytes .decode ('utf-8' )
11051105
1106- url = f"http://aj.ry188.vip/api/UpJoinGroupUrl.aspx?Account={ self .username } &Urls={ encoded_task_name } "
1106+ url = f"http://aj.ry188.vip/api/UpJoinGroupUrl.aspx?Account={ self .account } &Urls={ encoded_task_name } "
11071107
11081108 timeout = aiohttp .ClientTimeout (total = 10 )
11091109 async with aiohttp .ClientSession (timeout = timeout ) as session :
@@ -1120,7 +1120,7 @@ async def report_up_post_status(self, task_name):
11201120 """异步上报推文網址"""
11211121 try :
11221122 task_name = await self .extract_posturl_ids (task_name )
1123- url = f"http://aj.ry188.vip/api/UpPostUrl.aspx?Account={ self .username } &PostId={ task_name } &UserNumber={ self .customer_code } &GroupName="
1123+ url = f"http://aj.ry188.vip/api/UpPostUrl.aspx?Account={ self .account } &PostId={ task_name } &UserNumber={ self .customer_code } &GroupName="
11241124
11251125 timeout = aiohttp .ClientTimeout (total = 10 )
11261126 async with aiohttp .ClientSession (timeout = timeout ) as session :
@@ -1137,7 +1137,7 @@ async def report_up_fans_post_status(self,user_numer, task_name):
11371137 """异步上报粉丝专页推文網址"""
11381138 try :
11391139 # task_name = await self.extract_posturl_ids(task_name)
1140- url = f"http://aj.ry188.vip/api/UpPagesPostUrl.aspx?Account={ self .username } &UserNumber={ user_numer } &Urls={ task_name } "
1140+ url = f"http://aj.ry188.vip/api/UpPagesPostUrl.aspx?Account={ self .account } &UserNumber={ user_numer } &Urls={ task_name } "
11411141
11421142 timeout = aiohttp .ClientTimeout (total = 10 )
11431143 async with aiohttp .ClientSession (timeout = timeout ) as session :
@@ -1154,7 +1154,7 @@ async def report_dawn_post_status(self, task_name):
11541154 """异步上报刪除推文網址"""
11551155 try :
11561156 task_name = await self .extract_posturl_ids (task_name )
1157- url = f"http://aj.ry188.vip/api/DeleteUrls.aspx?Account={ self .username } &PostId={ task_name } "
1157+ url = f"http://aj.ry188.vip/api/DeleteUrls.aspx?Account={ self .account } &PostId={ task_name } "
11581158
11591159 timeout = aiohttp .ClientTimeout (total = 10 )
11601160 async with aiohttp .ClientSession (timeout = timeout ) as session :
@@ -1179,7 +1179,7 @@ async def report_up_tweet_comment(self, task_name,code):
11791179 print ("提取的群组ID:" , group_id )
11801180 else :
11811181 print ("未找到群组ID" )
1182- url = f"http://aj.ry188.vip/api/UpUrls.aspx?Account={ self .username } &Urls={ task_name } &GroupId={ group_id } &GroupName='123'&PostId={ task_name2 } &UserNumber={ code } "
1182+ url = f"http://aj.ry188.vip/api/UpUrls.aspx?Account={ self .account } &Urls={ task_name } &GroupId={ group_id } &GroupName='123'&PostId={ task_name2 } &UserNumber={ code } "
11831183
11841184 timeout = aiohttp .ClientTimeout (total = 10 )
11851185 async with aiohttp .ClientSession (timeout = timeout ) as session :
@@ -1278,7 +1278,7 @@ async def sleep_time(self, rest_time=60):
12781278 async def report_online_status (self ):
12791279 """异步上报在线状态"""
12801280 try :
1281- url = f"http://aj.ry188.vip/API/UpDataState.aspx?Account={ self .username } &DeviceNumber={ self .device_number } &DeviceCode={ self .machine_code } &IsPhone={ self .is_phone } &RemoteId={ self .remote_id } &RunText=在线"
1281+ url = f"http://aj.ry188.vip/API/UpDataState.aspx?Account={ self .account } &DeviceNumber={ self .device_number } &DeviceCode={ self .machine_code } &IsPhone={ self .is_phone } &RemoteId={ self .remote_id } &RunText=在线"
12821282
12831283 # 使用 aiohttp 进行异步请求
12841284 timeout = aiohttp .ClientTimeout (total = 10 ) # 设置10秒超时
@@ -1296,7 +1296,7 @@ async def report_online_status(self):
12961296 async def report_task_status (self , task_name ):
12971297 """异步上报任务执行状态"""
12981298 try :
1299- url = f"http://aj.ry188.vip/API/UpDataRunState.aspx?Account={ self .username } &DeviceNumber={ self .device_number } &RunText={ task_name } &DeviceCode={ self .machine_code } &IsPhone={ self .is_phone } &RemoteId={ self .remote_id } "
1299+ url = f"http://aj.ry188.vip/API/UpDataRunState.aspx?Account={ self .account } &DeviceNumber={ self .device_number } &RunText={ task_name } &DeviceCode={ self .machine_code } &IsPhone={ self .is_phone } &RemoteId={ self .remote_id } "
13001300
13011301 timeout = aiohttp .ClientTimeout (total = 10 )
13021302 async with aiohttp .ClientSession (timeout = timeout ) as session :
0 commit comments