fix redirect with is_shorts

This commit is contained in:
Simon 2024-05-21 20:55:36 +02:00
parent 40beb35f34
commit 7111fedd5c
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 2 additions and 1 deletions

View File

@ -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