mirror of
				https://github.com/tiyn/stud.ip-crawler.git
				synced 2025-10-30 18:51:17 +01:00 
			
		
		
		
	bugfixes: error solving for unwritable files
This commit is contained in:
		| @@ -143,11 +143,14 @@ class Studip: | ||||
|             #total_size = int(rsp2.headers.get('content-length', 0)) | ||||
|             log.info('downloading ' + doc_name) | ||||
|             #progbar = tqdm(total=total_size, unit='iB', unit_scale=True) | ||||
|             with open(doc_name, 'wb') as doc_file: | ||||
|                 for chunk in rsp2.iter_content(self.CHUNK_SIZE): | ||||
|                     #progbar.update(len(chunk)) | ||||
|                     doc_file.write(chunk) | ||||
|             self.db.set_last_file_dl(str(doc), str(int(time.time()))) | ||||
|             try: | ||||
|                 with open(doc_name, 'wb') as doc_file: | ||||
|                     for chunk in rsp2.iter_content(self.CHUNK_SIZE): | ||||
|                         #progbar.update(len(chunk)) | ||||
|                         doc_file.write(chunk) | ||||
|                 self.db.set_last_file_dl(str(doc), str(int(time.time()))) | ||||
|             except: | ||||
|                 log.CRITICAL("Error while writing to the file " + doc_name) | ||||
|  | ||||
|     def get_subdirs(self, folder): | ||||
|         """Get all the subdirectories of a given folder. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user