Ejemplo n.º 1
0
 def download_main_image(self, folderpath, printing=False):
     self.saved_path = text_manip.get_file(
         url=self.main_img_link, folderpath=folderpath, printing=False)
     self.direct_image_link = self.main_img_link.split("https:")[-1]
     self.saved_filename = self.saved_path.split('/')[-1]
     if printing:
         print "\n\n\nself.saved_filename:", self.saved_filename
Ejemplo n.º 2
0
	def download_direct_image(self,folderpath, printing=False):
		if self.direct_image_link is not None:
			link = self.direct_image_link #don'e modify self.direct_image_link
			if link[:6] != "https:":
				link="https:"+link
			self.saved_path=text_manip.get_file( url=link, folderpath=folderpath, printing=False)
			self.saved_filename=self.saved_path.split('/')[-1]
		else:
			download_main_image(folderpath, printing)
Ejemplo n.º 3
0
	def download_smallest_image(self, folderpath, printing=False):
		if self.img_px_to_links_map!={}:
			min_index=min(self.img_px_to_links_map)
			min_link=self.img_px_to_links_map[min_index][0]
			self.saved_path=text_manip.get_file( url=min_link, folderpath=folderpath, printing=False )
			self.direct_image_link=min_link.split("https:")[-1]
			if printing:
				print "self.direct_image_link :",self.direct_image_link
			self.saved_filename=self.saved_path.split('/')[-1] 
		else:
			if printing:
				print "ERROR in download_smallest_image: The extraction is empty. Downloading main image instead"