mirror of
				https://codeberg.org/ashley/poke
				synced 2025-07-17 16:52:11 +00:00 
			
		
		
		
	add try catch :p
This commit is contained in:
		
							parent
							
								
									d81d66b461
								
							
						
					
					
						commit
						517f67958c
					
				| @ -30,6 +30,7 @@ function getJson(str) { | ||||
| 
 | ||||
| module.exports = function (app, config, renderTemplate) { | ||||
|   app.get("/download", async function (req, res) { | ||||
|     try { | ||||
|     var v = req.query.v; | ||||
| 
 | ||||
|     // video
 | ||||
| @ -53,6 +54,9 @@ module.exports = function (app, config, renderTemplate) { | ||||
|         .getColors(`https://i.ytimg.com/vi/${v}/maxresdefault.jpg`) | ||||
|         .then((colors) => colors[0].hex()), | ||||
|     }); | ||||
|     } catch { | ||||
|       res.redirect("/") | ||||
|     } | ||||
|   }); | ||||
| 
 | ||||
|   app.get("/old/watch", async function (req, res) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Ashley
						Ashley