1
0
mirror of https://git.sr.ht/~cadence/NewLeaf synced 2024-11-21 23:27:29 +00:00

Add kwargs to all endpoints

This commit is contained in:
Cadence Ember 2020-08-09 23:42:15 +12:00
parent 0493e5a236
commit c9e995473f
No known key found for this signature in database
GPG Key ID: 128B99B1B74A6412

View File

@ -50,7 +50,7 @@ class Second(object):
@cherrypy.expose
@cherrypy.tools.json_out()
def videos(self, id):
def videos(self, id, **kwargs):
if id in self.video_cache:
return self.video_cache[id]
@ -273,7 +273,7 @@ class Second(object):
@cherrypy.expose
@cherrypy.tools.encode()
def manifest(self, id):
def manifest(self, id, **kwargs):
id = id.split(".")[0] # remove extension if present
video = self.videos(id)
@ -325,7 +325,7 @@ class Second(object):
@cherrypy.expose
@cherrypy.tools.json_out()
def channels(self, *suffix):
def channels(self, *suffix, **kwargs):
ucid = ""
part = ""
if len(suffix) == 1:
@ -389,7 +389,7 @@ class Second(object):
@cherrypy.expose
@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)
return list({
"type": "video",