示例#1
0
文件: user.py 项目: Loreleix64/Lamia
	def search_images(self, tag_string, pages):
		results = []	
		for i in xrange(pages):
			search = requests.get(("http://danbooru.donmai.us/posts.json?limit=20&page=" + str(i) + "&tags=" + tag_string), auth=HTTPBasicAuth(self.user, self.key))
			table = search.json()
			for posts in table:
				img = queries.post(posts, None, self)
				results.append(img)
				
		return results
示例#2
0
文件: user.py 项目: Loreleix64/Lamia
	def create_image(self, image_id):
		image_table = requests.get(("http://danbooru.donmai.us/posts/" + image_id + ".json"), auth=HTTPBasicAuth(self.user, self.key))
		image = queries.post(image_table, image_id, self)
		
		return image