python代码:
import os
import requests
import json
from urllib import parse
path='E:\me\wallpaper\wzry'
#每个分辨率一个目录,
size_list=['','','1024x768','1280x720','1280x1024','1440x900','1920x1080','1920x1280','1920x1440']
for page in range(0,24):
print("第"+str(page)+"页")
url = 'https://apps.game.qq.com/cgi-bin/ams/module/ishow/V1.0/query/workList_inc.cgi?activityId=2735&sVerifyCode=ABCD&sDataType=JSON&iListNum=20&totalpage=0&page='
+ str(page)+
'&iOrder=0&iSortNumClose=1&jsoncallback=jQuery17100316096202658831_1609834178230&iAMSActivityId=51991&_everyRead=true&iTypeId=2&iFlowId=267733&iActId=2735&iModuleId=2735&_=1609836282840'
#
im = requests.get(url) # 请求url
text = im.text.replace("jQuery17100316096202658831_1609834178230(","").replace('
', '').replace('
', '')
siz = len(text)
objStr = text[0:siz - 1]
map = json.loads(objStr)
lst = map["List"]
print("本页个数"+str(len(lst)))
for it in lst :
name = parse.unquote(it["sProdName"]).replace(':','').replace('·','')
print("正在执行"+name)
for num in range(2, 9):
url = parse.unquote(it["sProdImgNo_" + str(num)])
url = url.replace('/200', '/0')
dirPath = path + '\' + str(size_list[num])
if not os.path.exists(dirPath):
os.mkdir(dirPath)
os.chdir(dirPath)
im = requests.get(url) # 请求url
if im.status_code == 200:
open(name + '_' + size_list[num] + '.jpg', 'wb').write(im.content) # 写入文件