ai项目
This commit is contained in:
@@ -14,7 +14,6 @@ from Utils.Requester import Requester
|
||||
|
||||
# 脚本管理类
|
||||
class ScriptManager():
|
||||
|
||||
# 单利对象
|
||||
_instance = None # 类变量,用于存储单例实例
|
||||
|
||||
@@ -103,7 +102,6 @@ class ScriptManager():
|
||||
print(f"发生异常:{e}")
|
||||
client.swipe_up()
|
||||
|
||||
|
||||
# 观看直播
|
||||
def watchLiveForGrowth(self, udid, event):
|
||||
client = wda.USBClient(udid)
|
||||
@@ -178,8 +176,6 @@ class ScriptManager():
|
||||
time.sleep(2)
|
||||
session = client.session()
|
||||
|
||||
|
||||
|
||||
# 关注打招呼以及回复主播消息
|
||||
def greetNewFollowers(self, udid, needReply, event):
|
||||
client = wda.USBClient(udid)
|
||||
@@ -285,7 +281,7 @@ class ScriptManager():
|
||||
# 如果打开视频失败。说明该主播没有视频
|
||||
if cellClickResult == True:
|
||||
# 观看主播视频
|
||||
LogManager.info("去查看主播视频",udid)
|
||||
LogManager.info("去查看主播视频", udid)
|
||||
viewAnchorVideo()
|
||||
time.sleep(3)
|
||||
LogManager.info("视频看完了,重置试图查询深度", udid)
|
||||
@@ -372,18 +368,20 @@ class ScriptManager():
|
||||
# 点击搜索按钮
|
||||
ControlUtils.clickSearch(session)
|
||||
|
||||
# 检查未读消息并回复
|
||||
def monitorMessages(self, session, udid):
|
||||
|
||||
def replyMessages(self, udid, event):
|
||||
client = wda.USBClient(udid)
|
||||
session = client.session()
|
||||
ControlUtils.closeTikTok(session, udid)
|
||||
time.sleep(2)
|
||||
|
||||
ControlUtils.closeTikTok(session, udid)
|
||||
ControlUtils.openTikTok(session, udid)
|
||||
time.sleep(3)
|
||||
while event.is_set:
|
||||
self.monitorMessages(session, udid)
|
||||
|
||||
# 检查未读消息并回复
|
||||
def monitorMessages(self, session, udid):
|
||||
session.appium_settings({"snapshotMaxDepth": 7})
|
||||
el = session(xpath='//XCUIElementTypeButton[@name="a11y_vo_inbox"]')
|
||||
|
||||
# 如果收件箱有消息 则进行点击
|
||||
if el.exists:
|
||||
m = re.search(r'(\d+)', el.label) # 抓到的第一个数字串
|
||||
@@ -531,15 +529,12 @@ class ScriptManager():
|
||||
print("当前屏幕没有找到 用户 未读徽标数字")
|
||||
badge_text = None
|
||||
|
||||
|
||||
def test(self, udid):
|
||||
client = wda.USBClient(udid)
|
||||
session = client.session()
|
||||
session.appium_settings({"snapshotMaxDepth": 10})
|
||||
print(client.source())
|
||||
|
||||
|
||||
# manager = ScriptManager()
|
||||
# manager.test("eca000fcb6f55d7ed9b4c524055214c26a7de7aa")
|
||||
# manager.growAccount("eca000fcb6f55d7ed9b4c524055214c26a7de7aa")
|
||||
|
||||
# manager.test("2335890f77fb51322361bd46b85f7fd1311aed53")
|
||||
# manager.growAccount("2335890f77fb51322361bd46b85f7fd1311aed53")
|
||||
|
||||
Reference in New Issue
Block a user