代码如下
#-*- encoding: utf-8 -*-
# Generated by recorder.
from time import sleep
from os import system
from subprocess import getoutput
import requests,pymysql,random
import atx
import random
#环境安装步骤如下
#python 版本号 3.70
# pip install --upgrade --pre uiautomator2
# python3 -m uiautomator2 init
# pip install -U weditor
# weditor --shortcut 创建
#金币比例 30000 比 1 软妹币
#撸羊毛代码。。。。。。。,今日头条阅读挂机。
#Source Code Witer By TonyShu
#今日头条极速版 邀请码:1055472046
def ReadBook(n,time_count):
time_sleep = random.randint(5,10)
dClick = random.randint(dW,dH)
# d(className=u"android.widget.ImageView", resourceId=u"com.bytedance.novelplugin:id/novel_coin_exciting_ad_dismiss_btn").click(timeout=2200)
# Kill 弹窗,躲避视频广告,不差这点金币
d.swipe(800,dClick,100,dClick)
# subprocess.Popen("adb shell input swipe {} {} {} {} {}".format(1000,1130,200,1130,step_), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print('正在使用今日头条读书--已点击{}下!本章看了{}秒!总共阅读{}分钟'.format(n,time_sleep,round(time_count/60,2)))
sleep(time_sleep)
return time_sleep
if __name__ == "__main__":
d = atx.connect("5af3da78")
#开启调试模式
d.debug = True
dInfo=d.info
dW = int(dInfo['displayWidth'])
dH = int(dInfo['displayHeight'])
# subprocess.Popen("adb connect ", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
n = 1
time_count = 1
while 1:
#生成随机整数,假装上翻下翻页
rondom = random.randint(1,1)
time_sleep = ReadBook(n,time_count)
time_count += time_sleep
n += 1
运行效果如下: