mirror of
				https://git.sr.ht/~cadence/NewLeaf
				synced 2025-10-31 19:45:36 +00:00 
			
		
		
		
	Add kwargs to all endpoints
This commit is contained in:
		
							parent
							
								
									0493e5a236
								
							
						
					
					
						commit
						c9e995473f
					
				
							
								
								
									
										8
									
								
								index.py
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								index.py
									
									
									
									
									
								
							| @ -50,7 +50,7 @@ class Second(object): | |||||||
| 
 | 
 | ||||||
| 	@cherrypy.expose | 	@cherrypy.expose | ||||||
| 	@cherrypy.tools.json_out() | 	@cherrypy.tools.json_out() | ||||||
| 	def videos(self, id): | 	def videos(self, id, **kwargs): | ||||||
| 		if id in self.video_cache: | 		if id in self.video_cache: | ||||||
| 			return self.video_cache[id] | 			return self.video_cache[id] | ||||||
| 
 | 
 | ||||||
| @ -273,7 +273,7 @@ class Second(object): | |||||||
| 
 | 
 | ||||||
| 	@cherrypy.expose | 	@cherrypy.expose | ||||||
| 	@cherrypy.tools.encode() | 	@cherrypy.tools.encode() | ||||||
| 	def manifest(self, id): | 	def manifest(self, id, **kwargs): | ||||||
| 		id = id.split(".")[0] # remove extension if present | 		id = id.split(".")[0] # remove extension if present | ||||||
| 		video = self.videos(id) | 		video = self.videos(id) | ||||||
| 
 | 
 | ||||||
| @ -325,7 +325,7 @@ class Second(object): | |||||||
| 
 | 
 | ||||||
| 	@cherrypy.expose | 	@cherrypy.expose | ||||||
| 	@cherrypy.tools.json_out() | 	@cherrypy.tools.json_out() | ||||||
| 	def channels(self, *suffix): | 	def channels(self, *suffix, **kwargs): | ||||||
| 		ucid = "" | 		ucid = "" | ||||||
| 		part = "" | 		part = "" | ||||||
| 		if len(suffix) == 1: | 		if len(suffix) == 1: | ||||||
| @ -389,7 +389,7 @@ class Second(object): | |||||||
| 
 | 
 | ||||||
| 	@cherrypy.expose | 	@cherrypy.expose | ||||||
| 	@cherrypy.tools.json_out() | 	@cherrypy.tools.json_out() | ||||||
| 	def search(self, *, q, sort_by, page, date, duration, type): | 	def search(self, *, q, **kwargs): | ||||||
| 		info = ytdl.extract_info("ytsearchall:{}".format(q), download=False) | 		info = ytdl.extract_info("ytsearchall:{}".format(q), download=False) | ||||||
| 		return list({ | 		return list({ | ||||||
| 			"type": "video", | 			"type": "video", | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user