importrequestsimportreimportosimporttimeprint("ready....")defdownPic(dirs, keyword, imgId):
headers_downPic={'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8','Accept-Encoding': 'gzip, deflate, br','Accept-Language': 'zh-CN,zh;q=0.9','Cache-Control': 'no-cache','Connection': 'keep-alive','Host': 'p9.pstatp.com','Pragma': 'no-cache','Upgrade-Insecure-Requests': '1','User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36',
}
url= 'https://p9.pstatp.com/weili/l/{}.webp'.format(imgId)print("line20:"+url)whileTrue:try:
res= requests.get(url, headers=headers_downPic)break
except: