mirror of
				https://github.com/searxng/searxng
				synced 2024-01-01 19:24:07 +01:00 
			
		
		
		
	[fix] engine - invidious thumbnails
This commit is contained in:
		
							parent
							
								
									ed3819bdd5
								
							
						
					
					
						commit
						6039dbf211
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
					@ -5,7 +5,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import time
 | 
					import time
 | 
				
			||||||
import random
 | 
					import random
 | 
				
			||||||
from urllib.parse import quote_plus
 | 
					from urllib.parse import quote_plus, urlparse
 | 
				
			||||||
from dateutil import parser
 | 
					from dateutil import parser
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# about
 | 
					# about
 | 
				
			||||||
| 
						 | 
					@ -75,6 +75,11 @@ def response(resp):
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                thumbnail = ""
 | 
					                thumbnail = ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            # some instances return a partial thumbnail url
 | 
				
			||||||
 | 
					            # we check if the url is partial, and prepend the base_url if it is
 | 
				
			||||||
 | 
					            if thumbnail and not urlparse(thumbnail).netloc:
 | 
				
			||||||
 | 
					                thumbnail = resp.search_params['base_url'] + thumbnail
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            publishedDate = parser.parse(time.ctime(result.get("published", 0)))
 | 
					            publishedDate = parser.parse(time.ctime(result.get("published", 0)))
 | 
				
			||||||
            length = time.gmtime(result.get("lengthSeconds"))
 | 
					            length = time.gmtime(result.get("lengthSeconds"))
 | 
				
			||||||
            if length.tm_hour:
 | 
					            if length.tm_hour:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue