From acb21b0636a34846c9d2a7cd71a1491fe5e7ef4d Mon Sep 17 00:00:00 2001 From: girst Date: Fri, 24 Jul 2020 22:07:34 +0200 Subject: [PATCH] don't use proxy for videos that don't need it --- app/youtube/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/youtube/__init__.py b/app/youtube/__init__.py index ea8d1b8..c80b8ed 100644 --- a/app/youtube/__init__.py +++ b/app/youtube/__init__.py @@ -82,11 +82,12 @@ def watch(): # if the video is geolocked, and the proxy is enabled, we can still play it: try: - videoplayback = url_for('proxy.videoplayback') - query = urlparse(video_url).query + if error == 'geolocked': + error = None + videoplayback = url_for('proxy.videoplayback') + query = urlparse(video_url).query - video_url = f"{videoplayback}?{query}" - if error == 'geolocked': error = None + video_url = f"{videoplayback}?{query}" except: pass show = request.args.get("show") -- 2.39.3