From 269ece679faf8e652244250f5e06fd5bc6c99fd1 Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Fri, 7 Jul 2023 20:40:36 +0200 Subject: [PATCH] derp --- backend/config.py | 4 +++- backend/stream.py | 17 +++++++++-------- backend/stream_providers.py | 3 ++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/backend/config.py b/backend/config.py index ea0ddfd..810720e 100644 --- a/backend/config.py +++ b/backend/config.py @@ -115,7 +115,9 @@ class ProxyElem: try: async with self.local() as session: - resp = await session.post(proxy_server, json=json.loads(request_data.json())) + resp = await session.post( + proxy_server, json=json.loads(request_data.json()) + ) response_data = cast( ProxyResponse, ProxyResponse.parse_raw(await resp.text()) ) diff --git a/backend/stream.py b/backend/stream.py index 0ebb791..52f8d4a 100755 --- a/backend/stream.py +++ b/backend/stream.py @@ -168,15 +168,16 @@ class MainHandler(tornado.web.RequestHandler): video_info.download = None video_info.poster = proxied[2] + if video_info.upstream: + video_info.upstream = str(video_info.upstream) + if video_info.download: + video_info.download = str(video_info.download) + if video_info.poster: + video_info.poster = str(video_info.poster) + if video_info.ctype: + video_info.ctype = str(video_info.ctype) + return ( - if video_info.upstream: - video_info.upstream = str(video_info.upstream) - if video_info.download: - video_info.download = str(video_info.download) - if video_info.poster: - video_info.poster = str(video_info.poster) - if video_info.ctype: - video_info.ctype = str(video_info.ctype) dataclasses.asdict(video_info), provider_data.meta(), provider_data.title(), diff --git a/backend/stream_providers.py b/backend/stream_providers.py index 5c572ee..f0eb779 100755 --- a/backend/stream_providers.py +++ b/backend/stream_providers.py @@ -9,6 +9,7 @@ import requests import yt_dlp as youtube_dl import config + class DummyLogger: def debug(self, msg): pass @@ -163,7 +164,7 @@ class StreamProvider: proxies = {} proxies["http"] = "socks5://" + self.proxy.proxy proxies["https"] = "socks5://" + self.proxy.proxy - + ctype = None upstream = data.upstream() try: