import subprocess
from paddleocr import PaddleOCR
def clickLike(limit_number):
subprocess.run('adb shell screencap -p /sdcard/screenshot0.png')
subprocess.run('adb pull /sdcard/screenshot0.png .')
ocr = PaddleOCR(use_angle_cls=True, lang="ch")
result=ocr.ocr('screenshot0.png',cls=True)
# print('识别结果',result)
isNexZan=False
for line in result:
for world_info in line:
print(world_info)
if isNexZan and '条回复' not in world_info[-1][0]:
number=world_info[-1][0].replace('\'','').replace('Q','')
print(number)
if number.isdigit():
int_number =int(number)
if(int_number<limit_number):
x=world_info[0][0][0]
y=world_info[0][1][1]
print(x,y);
subprocess.run('adb shell input tap '+str(x) +' '+str(y))
isNexZan=False
if '回复' in world_info[-1][0] and '查看' not in world_info[-1][0]:
isNexZan=True
subprocess.run('adb shell input swipe 200 1300 200 500')
if __name__ == "__main__":
#点赞数在300内 才点赞
limit_number = 300
while True:
clickLike(limit_number)
能力有限,自己瞎编写的记录下