From 26333f7f2b0a09b24a25e869b38fb6113e11ea51 Mon Sep 17 00:00:00 2001 From: girst Date: Sat, 29 Aug 2020 11:16:38 +0200 Subject: [PATCH] we're blockable :( --- app/common/common.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/common/common.py b/app/common/common.py index 267a8da..3b86e7a 100644 --- a/app/common/common.py +++ b/app/common/common.py @@ -214,6 +214,10 @@ def get_video_info(video_id, sts=0, algo=""): "sts": sts, "hl": "en_US", }) + + if r.status_code == 429: + return None, None, None, 'banned', 'possible IP ban' + params = parse_qs(r.text) if 'errorcode' in params: # status=fail return None, None, None, 'malformed', params['reason'][0] -- 2.39.3