Don't use images from pixiv over 10MB
This commit is contained in:
		
							parent
							
								
									5916b87190
								
							
						
					
					
						commit
						a7de409535
					
				| 
						 | 
				
			
			@ -82,8 +82,9 @@ async def saucenao(client, message):
 | 
			
		|||
                                    pimg = json['body']['illust_details'].get(i)
 | 
			
		||||
                                    if pimg:
 | 
			
		||||
                                        if await download_file(pimg, filename, url):
 | 
			
		||||
                                            to_image = True
 | 
			
		||||
                                            break
 | 
			
		||||
                                            if os.path.getsize(filename) < 10000000:
 | 
			
		||||
                                                to_image = True
 | 
			
		||||
                                                break
 | 
			
		||||
                    if await download_file(url, filename):
 | 
			
		||||
                        with open(filename) as file:
 | 
			
		||||
                            soup = BeautifulSoup(file.read())
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue