额,最近发现手机壁纸似乎有段时间没换了,刚好又看到网上有一个APP叫做4k超清壁纸
似乎很厉害的样子,然后我就抓包,发现这家APP的心真大。
先来一张效果图
打开Burp,打开软件,设置好burp和模拟器
然后清空现有的记录,app内刷新一下
多了4条
然后就找到接口了。。。
感觉现在的一些APP用的http协议就跟玩一样,直接get就能获取所有信息了。。。
https://api.wallpaperscraft.com/images?screen[width]=1080&screen[height]=1920&sort=date&lang=en&limit=60&offset=0
然后就是python代码:
import os import threading import requests def get_url(): url = 'https://api.wallpaperscraft.com/images?screen[width]=1080&screen[height]=1920&sort=rating&lang=en&limit=1000000&offset=0' headers = { 'User-Agent': 'okhttp/3.8.0', } data = requests.get(url, headers).json() data = data['items'] originals = [] adapteds = [] adapted_landscapes = [] for i in data: variation = i['variations'] originals.append(variation['original']['url']) adapteds.append(variation['adapted']['url']) adapted_landscapes.append(variation['adapted_landscape']['url']) print('链接已整合完毕') return originals, adapteds, adapted_landscapes def down_originals(urls): print('开始执行down_originals') if not os.path.exists('originals'): os.makedirs('originals') for i in urls: img_data = requests.get(i).content filename = i[42:] with open('originals/' + filename, 'wb') as f: f.write(img_data) print(f'已下载{filename}') def down_adapteds(urls): print('开始执行down_adapteds') if not os.path.exists('adapteds'): os.makedirs('adapteds') for i in urls: img_data = requests.get(i).content filename = i[42:] with open('adapteds/' + filename, 'wb') as f: f.write(img_data) print(f'已下载{filename}') def down_adapted_landscapes(urls): print('开始执行down_adapted_landscapes') if not os.path.exists('adapted_landscapes'): os.makedirs('adapted_landscapes') for i in urls: img_data = requests.get(i).content filename = i[42:] with open('adapted_landscapes/' + filename, 'wb') as f: f.write(img_data) print(f'已下载{filename}') if __name__ == '__main__': all_url = get_url() originals = all_url[0] adapteds = all_url[1] adapted_landscapes = all_url[2] print('url已分类整合完毕') t1 = threading.Thread(target=down_originals, args=(originals,)) t2 = threading.Thread(target=down_adapteds, args=(adapteds,)) t3 = threading.Thread(target=down_adapted_landscapes, args=(adapted_landscapes,)) t3.start() t2.start() t1.start()
手机那有软件可以加api换壁纸,现在缺好的api