From a63bb003c71e868bad3fc561799f349a7a2ad330 Mon Sep 17 00:00:00 2001 From: girst Date: Sun, 9 Jan 2022 00:11:44 +0100 Subject: [PATCH] remove 2nd no-url bailout again this replaces 18bf5ede; the problem was that without url, the call to urlparse() would fail. bailing out at this point however breaks livestreams (and premieres). the real fix is of course to not check for geolocking if there's no url. --- app/common/common.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/common/common.py b/app/common/common.py index 08ac805..06a627a 100644 --- a/app/common/common.py +++ b/app/common/common.py @@ -281,11 +281,12 @@ def get_video_info(video_id, *, metaOnly=False, _embed=True): try: url = sorted(formats, key=lambda k: k['height'], reverse=True)[0]['url'] - except: - return None, None, metadata, 'no-url', player_error - # ip-locked videos can be recovered if the proxy module is loaded: - is_geolocked = 'gcr' in parse_qs(urlparse(url).query) + # ip-locked videos can be recovered if the proxy module is loaded: + is_geolocked = 'gcr' in parse_qs(urlparse(url).query) + except: + url = None + is_geolocked = False nonfatal = 'livestream' if is_live \ else 'geolocked' if is_geolocked \ -- 2.39.3