From 7111fedd5cf2d654f3f283de4516c387b7d0b2b6 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 21 May 2024 20:55:36 +0200 Subject: [PATCH] fix redirect with is_shorts --- tubearchivist/home/src/ta/helper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tubearchivist/home/src/ta/helper.py b/tubearchivist/home/src/ta/helper.py index ea2eb999..88c6b50d 100644 --- a/tubearchivist/home/src/ta/helper.py +++ b/tubearchivist/home/src/ta/helper.py @@ -140,8 +140,9 @@ def get_mapping() -> dict: def is_shorts(youtube_id: str) -> bool: """check if youtube_id is a shorts video, bot not it it's not a shorts""" shorts_url = f"https://www.youtube.com/shorts/{youtube_id}" + cookies = {"SOCS": "CAI"} response = requests.head( - shorts_url, headers=requests_headers(), timeout=10 + shorts_url, cookies=cookies, headers=requests_headers(), timeout=10 ) return response.status_code == 200