Tool Share (002)---anyproxy (可做接口抓取)
AnyProxy是一个基于NodeJS的,可供插件配置的HTTP/HTTPS代理服务器。
过年期间的时候使用 anyproxy + adb + 逍遥模拟器 + php驱动操作逻辑 +xposed(jesttrustme) 这个组合进行了抖音数据的爬取 ,其中 anyproxy 起到了数据劫持的作用,同理也可以用来对其他app接口进行抓取。 当时也使用了 fiddler、mitmproxy 但感觉不如 anyproxy 方便,所以最后还是采取了 anyproxy,因为本身是js代码,所以写扩展也比较容易。也是一款出自阿里巴巴的软件。可配合 pm2(node) 一起使用
放上当时php调用adb进行抖音翻页操作的代码
$adbPath = env('ADB_PATH');
$adbPath = 'C:\Users\HZJ\AppData\Local\Android\Sdk\platform-tools\adb.exe';
$adbVersion = `$adbPath version`;
$this->info($adbVersion);
$standardH = 1440;
$standardW = 960;
$start = new Coordinate();
$start->x = $standardW / 2;
$start->y = (int) ($standardH / 7 * 4);
$end = new Coordinate();
$end->x = $standardW / 2;
$end->y = (int) ($standardH / 7);
while (true) {
exec("{$adbPath} shell input swipe {$start->x} {$start->y} {$end->x} {$end->y}");
$runTime = (microtime(true) - LARAVEL_START);
$this->info('运行时长:' . $runTime);
}
return ;
本作品采用《CC 协议》,转载必须注明作者和本文链接