diff --git a/telegram/8619211027341.session b/telegram/8619211027341.session index 6972a42..b4d77d2 100644 Binary files a/telegram/8619211027341.session and b/telegram/8619211027341.session differ diff --git a/telegram/bot_session.session b/telegram/bot_session.session index ece3268..d4cb136 100644 Binary files a/telegram/bot_session.session and b/telegram/bot_session.session differ diff --git a/telegram/sign.db b/telegram/sign.db index d15468b..81f3051 100644 Binary files a/telegram/sign.db and b/telegram/sign.db differ diff --git a/推特/main.py b/推特/main.py index 92da972..ff4deb2 100644 --- a/推特/main.py +++ b/推特/main.py @@ -1,3 +1,4 @@ +import threading import time import pyotp import random @@ -29,16 +30,16 @@ class Hub_Web: self.create_Browser() # 创建浏览器 if self.get_page(): - logger.info(f"推特名字:{self.x_info.user_name},浏览器打开成功") + logger.info(f",浏览器打开成功") else: - logger.error(f"推特名字:{self.x_info.user_name},浏览器打开失败") + logger.error(f",浏览器打开失败") return if self.login_x_main(): self.xstart_info.start = 1 self.xstart_info.save() - logger.success(f"推特名字:{self.x_info.user_name},登录x成功!!!") + logger.success(f",登录x成功!!!") # time.sleep(25) # @@ -48,7 +49,7 @@ class Hub_Web: # self.xstart_info.save() else: - logger.error(f"推特名字:{self.x_info.user_name},登录x失败!!!") + logger.error(f",登录x失败!!!") self.xstart_info.start = 0 self.xstart_info.save() @@ -66,7 +67,7 @@ class Hub_Web: fz_datas = get_group_lists() bit_id = createBrowser( - name=self.x_info.user_name, + # name=self.x_info.user_name, proxyType="http", groupId=fz_datas['推特'], host="104.168.59.92", @@ -89,11 +90,12 @@ class Hub_Web: 'x://*[@id="react-root"]/div/div/div[2]/header/div/div/div/div[2]/div/button/div[2]/div/div/div/div[1]/span/span', timeout=10, ) + return True - if user_name and self.x_info.user_name.lower() == user_name.text.split("@")[-1].lower(): - return True - else: - return False + # if user_name and self.x_info.user_name.lower() == user_name.text.split("@")[-1].lower(): + # return True + # else: + # return False # self.x_tab.refresh() # time.sleep(5) @@ -175,7 +177,7 @@ class Hub_Web: self.xstart_info.start = 1 self.xstart_info.save() - logger.success(f"推特名字:{self.x_info.user_name},登录x成功!!!") + logger.success(f",登录x成功!!!") # time.sleep(25) # @@ -185,7 +187,7 @@ class Hub_Web: # self.xstart_info.save() else: - logger.error(f"推特名字:{self.x_info.user_name},登录x失败!!!") + logger.error(f",登录x失败!!!") self.xstart_info.start = 0 self.xstart_info.save() @@ -195,7 +197,7 @@ class Hub_Web: if self.x_testing(): return True else: - logger.info(f"推特名字:{self.x_info.user_name},开始登录x。。。") + logger.info(f",开始登录x。。。") if self.login_x(): return True @@ -737,7 +739,7 @@ def run_work(x_token_info, xstart_info): # hun_web = Hub_Web(x_info=x_token_info, xstart_info=xstart_info) # executor.submit(hun_web.to_do_tui) - with Hub_Web(x_info=x_token_info, xstart_info=xstart_info) as hub: + with Hub_Web(x_info=None, xstart_info=xstart_info) as hub: try: hub.account_nurturing() # 养号 except: @@ -750,48 +752,45 @@ def run_work(x_token_info, xstart_info): if __name__ == '__main__': - ensure_tables() - sync_xstart_from_bitbrowser(group_name="推特", max_pages=10) - - fz_datas = get_group_lists() - - for bit_data in get_browser_lists_Browser(id=fz_datas['推特']): - print(bit_data) - xstart_info, start = Xstart.get_or_create( - bit_id=bit_data["id"], - ) - if xstart_info.x_id: - # continue - - hun_web = Hub_Web(xstart_info=xstart_info) - - # hun_web.action() - - threading.Thread(target=hun_web.action).start() - time.sleep(random.randint(15, 60)) - - # # 同时运行 - # max_threads = 5 - # delay_between_start = 30 # 每次启动线程之间的延迟时间(秒) + # ensure_tables() + # sync_xstart_from_bitbrowser(group_name="推特", max_pages=10) # - # with ThreadPoolExecutor(max_workers=max_threads) as executor: + # fz_datas = get_group_lists() # - # # for x_token_info in XToken.select(): + # for bit_data in get_browser_lists_Browser(id=fz_datas['推特']): + # print(bit_data) + # xstart_info, start = Xstart.get_or_create( + # bit_id=bit_data["id"], + # ) + # if xstart_info.x_id: + # # continue # - # # 查询数据并转换为列表 - # random_x_infos = list(XToken.select()) - # # 直接对原列表进行打乱操作 - # random.shuffle(random_x_infos) + # hun_web = Hub_Web(xstart_info=xstart_info) # - # # 遍历打乱顺序后的列表 - # for x_token_info in random_x_infos: - # xstart_info, start = Xstart.get_or_create( - # x_id=x_token_info.id, - # ) + # # hun_web.action() # - # # if xstart_info.start: - # # continue - # - # executor.submit(run_work, x_token_info, xstart_info) - # # time.sleep(random.randint(60, 150)) - # time.sleep(delay_between_start) + # threading.Thread(target=hun_web.action).start() + # time.sleep(random.randint(15, 60)) + + # 同时运行 + max_threads = 5 + delay_between_start = 30 # 每次启动线程之间的延迟时间(秒) + + with ThreadPoolExecutor(max_workers=max_threads) as executor: + + # for x_token_info in XToken.select(): + + # 查询数据并转换为列表 + random_x_infos = list(Xstart.select()) + # 直接对原列表进行打乱操作 + random.shuffle(random_x_infos) + + # 遍历打乱顺序后的列表 + for x_token_info in random_x_infos: + + # if xstart_info.start: + # continue + + executor.submit(run_work, x_token_info, x_token_info) + # time.sleep(random.randint(60, 150)) + time.sleep(delay_between_start) diff --git a/推特/同步比特浏览器.py b/推特/同步比特浏览器.py index d17ca10..035a1fc 100644 --- a/推特/同步比特浏览器.py +++ b/推特/同步比特浏览器.py @@ -3,4 +3,4 @@ from db_init import ensure_tables, sync_xstart_from_bitbrowser if __name__ == '__main__': ensure_tables() - sync_xstart_from_bitbrowser(group_name="推特", max_pages=10) + sync_xstart_from_bitbrowser(group_name="西班牙语", max_pages=10)