mirror of
				https://codeberg.org/ashley/poke
				synced 2025-07-17 16:52:11 +00:00 
			
		
		
		
	fix video search
This commit is contained in:
		
							parent
							
								
									ae935825f4
								
							
						
					
					
						commit
						ab96d0fa34
					
				| @ -110,9 +110,11 @@ module.exports = function (app, config, renderTemplate) { | ||||
| 
 | ||||
|     if (query) { | ||||
|       let redirectTo = null; | ||||
|       let splitParam = ":"; | ||||
| 
 | ||||
|       if (query.includes("youtube.com/watch?v=")) { | ||||
|         redirectTo = "/watch?v="; | ||||
|         redirectTo = "/watch"; | ||||
|         splitParam = "?v="; | ||||
|       } else if (query.includes("channel:")) { | ||||
|         redirectTo = "/channel?id="; | ||||
|       } else if (query.includes("video:")) { | ||||
| @ -121,8 +123,8 @@ module.exports = function (app, config, renderTemplate) { | ||||
| 
 | ||||
|       if (redirectTo) { | ||||
|         try { | ||||
|           const id = query.split(":")[1]; | ||||
|           res.redirect(`${redirectTo}${id}`); | ||||
|           const id = query.split(splitParam)[1]; | ||||
|           res.redirect(`${redirectTo}${splitParam}${id}`); | ||||
|         } catch { | ||||
|           return; | ||||
|         } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 ashley
						ashley