match provider by prefix
This commit is contained in:
parent
f739418141
commit
ab34a21f2c
@ -139,9 +139,9 @@ class UpstreamHandler():
|
||||
if self.provider in providers.keys():
|
||||
self.valid = True
|
||||
path = handler.request.path
|
||||
if self.provider == "nextcloud":
|
||||
if self.provider.startswith("nextcloud"):
|
||||
path = path.removesuffix("/").removesuffix("download").removesuffix("/")
|
||||
elif self.provider == "youtube":
|
||||
elif self.provider.startswith("youtube"):
|
||||
path = path.removeprefix("/")
|
||||
self.upstream = providers[self.provider] + path
|
||||
proxy_list = proxies.get(self.provider)
|
||||
@ -215,7 +215,7 @@ class MainHandler(tornado.web.RequestHandler):
|
||||
async def handle_render(self, handler):
|
||||
if template_script is not None and template_html is not None:
|
||||
provider_data = None
|
||||
if handler.provider == "nextcloud":
|
||||
if handler.provider.startswith("nextcloud"):
|
||||
provider_data = await stream_providers.get_nextcloud(handler.upstream, handler.proxy, logger)
|
||||
else:
|
||||
provider_data = await stream_providers.get_any(handler.upstream, handler.proxy, logger)
|
||||
|
Loading…
Reference in New Issue
Block a user