# -*- coding:utf-8 -*-

 from mitmproxy import ctx
import json
import requests
import time
import os
path = "抖音视频/"
initUrl = ["http://v1-dy.bytecdn.cn","http://v2-dy.bytecdn.cn","http://v3-dy.bytecdn.cn","http://v4-dy.bytecdn.cn","http://v5-dy.bytecdn.cn","http://v6-dy.bytecdn.cn"] num = 0
def response(flow):
global num
for url in initUrl:
# 过滤掉不需要的url
if flow.request.url.startswith(url):
print(flow.request.url)
# 设置视频名
filename = path + str(num) + '.mp4'
print(filename)
# 使用request获取视频url的内容
# stream=True作用是推迟下载响应体直到访问Response.content属性 res = requests.get(flow.request.url, stream=True)
# 将视频写入文件夹
with open(filename, 'ab') as f:
f.write(res.content)
f.flush()
print(filename + '下载完成')
num += 1
 #   _*_ coding:utf-8 _*_

 import os

 #from PIL import Image

 import subprocess

 import time

 __author__ = 'admin'

 # order='adb devices' #获取连接设备
# pi= subprocess.Popen(order,shell=True,stdout=subprocess.PIPE)
# print(pi.stdout.read())#打印结果
def mobile_in(code):
# 开启电源键
# os.popen('adb shell input keyevent 26')
time.sleep(1)
# 滑动屏幕进入输入密码界面
os.popen('adb shell input swipe 539 1868 539 1600')
time.sleep(1)
for i in range(len(code)):
if code[i] == '':
# 密码盘上的“0”
os.popen('adb shell input swipe 480 1440 600 1550')
time.sleep(1)
elif code[i] == '':
# 密码盘上的“1”
os.popen('adb shell input swipe 200 740 320 860')
time.sleep(1)
elif code[i] == '':
# 密码盘上的“2”
os.popen('adb shell input swipe 480 740 600 860')
elif code[i] == '':
# 密码盘上的“3”
os.popen('adb shell input swipe 760 740 880 860')
elif code[i] == '':
# 密码盘上的“4”
os.popen('adb shell input swipe 200 990 320 1110')
elif code[i] == '':
# 密码盘上的“5”
os.popen('adb shell input swipe 480 990 600 1110')
elif code[i] == '':
# 密码盘上的“6”
os.popen('adb shell input swipe 760 990 880 1110')
elif code[i] == '':
# 密码盘上的“7”
os.popen('adb shell input swipe 200 1240 320 1360')
elif code[i] == '':
# 密码盘上的“8”
os.popen('adb shell input swipe 480 1240 600 1360')
elif code[i] == '':
# 密码盘上的“9”
os.popen('adb shell input swipe 760 1240 880 1360')
time.sleep(1) code = list('')
#手机解锁
#mobile_in(code) # startapp = "adb shell am start -n com.ss.android.ugc.aweme/.main.MainActivity" def loop(times):
for i in range(times):
os.popen('adb shell input swipe 539 800 539 400')
time.sleep(2) if __name__ == "__main__":
# os.popen(startapp)
time.sleep(5)
loop(30)

最新文章

  1. Python学习日志(二)
  2. Entity Framework 4.1 - Code First 指定外键名称
  3. SQL Server读懂语句运行的统计信息 SET STATISTICS TIME IO PROFILE ON
  4. vijos2001 xor-sigma
  5. [原]Wpf应用Path路径绘制圆弧
  6. GridView块布局
  7. PO_PO系列 - 收货管理分析(案例)
  8. 在swift中使用oc 的代码
  9. 显示GetLastError()的错误描述字符串
  10. 快速排序算法之我见(附上C代码)
  11. 关于ios原声嵌入web页面的问题
  12. Tomcat在Linux服务器上的BIO、NIO、APR模式设置
  13. groupby一个as_index参数解释
  14. spark提交任务的三种的方法
  15. 05-java学习-循环结构
  16. Redis五种数据结构(Windows Server)
  17. C语言基础第三次作业
  18. 数字配对(bzoj 4514)
  19. 【Error】安装程序无法打开注册表项 UNKNOWN\Components\...
  20. HDOJ.2084 数塔(DP)

热门文章

  1. WPF窗体自适应分辨率
  2. osgearth 编译日志
  3. matlab基本数据结构struct
  4. Django models中的\_\_repr__方法
  5. LODOP打印超文本保留背景色带平铺水印
  6. Linux查看CPU和内存使用情况总结
  7. AI - TensorFlow - 示例04:过拟合与欠拟合
  8. 常见问题:Web/Servlet生命周期与Spring Bean生命周期
  9. Mui manifest.json文档说明
  10. Action<T>和Func<T>委托事例