kopia lustrzana https://github.com/Aonrud/ila-microblog.pub
				
				
				
			Improve OG meta processing
							rodzic
							
								
									5348398b23
								
							
						
					
					
						commit
						57fc5ef913
					
				|  | @ -90,18 +90,22 @@ async def external_urls( | ||||||
|             if not h: |             if not h: | ||||||
|                 continue |                 continue | ||||||
| 
 | 
 | ||||||
|             ph = urlparse(h) |             try: | ||||||
|             mimetype, _ = mimetypes.guess_type(h) |                 ph = urlparse(h) | ||||||
|             if ( |                 mimetype, _ = mimetypes.guess_type(h) | ||||||
|                 ph.scheme in {"http", "https"} |                 if ( | ||||||
|                 and ph.hostname != note_host |                     ph.scheme in {"http", "https"} | ||||||
|                 and is_url_valid(h) |                     and ph.hostname != note_host | ||||||
|                 and ( |                     and is_url_valid(h) | ||||||
|                     not mimetype |                     and ( | ||||||
|                     or mimetype.split("/")[0] not in ["image", "video", "audio"] |                         not mimetype | ||||||
|                 ) |                         or mimetype.split("/")[0] not in ["image", "video", "audio"] | ||||||
|             ): |                     ) | ||||||
|                 urls.add(h) |                 ): | ||||||
|  |                     urls.add(h) | ||||||
|  |             except Exception: | ||||||
|  |                 logger.exception(f"Failed to check {h}") | ||||||
|  |                 continue | ||||||
| 
 | 
 | ||||||
|     return urls - tags_hrefs |     return urls - tags_hrefs | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Ładowanie…
	
		Reference in New Issue
	
	 Thomas Sileo
						Thomas Sileo